/* GDA01.js provides the scrip for updating the General Discussion Area (GDA)

Two variables are involved

(1) ShopCommentsURL and (2) PriorCommentsURL

These are the URLs called by the GDA interface on the Shop's Home Page.

The updating process is manual/semi-automated ... but, as currently configured, a very simple process

	
	Updating Steps 
	(1) From your Dashboard, select "NEW POST"  for "The Shop's General Discussion Area"
	(2) Give the new post a title ... we have been using "General Discussion Area" as the title, regardless of the comment set, but will be now using  ... "Comments Set # (Sequential nuumber)" or  "Comments From (Specified Date) ..."   Any Title can be used.  It will appear at the top of the comments page.
	(3) The post needs no text, just a title, but anything can be placed there ... i.e. reference notes
	(4) Publish the post  so that Blogger gives it a Post ID.
	(5)  Go to EDIT POSTS and put the post in the editor ... copy the Post ID from the browser's URL address window/bar
	(6)  Add the Post ID to the  "ShopCommentsPostID" array below.
	(7) Set the "PriorCommentsURL" variable's postID  = to the existing "ShopCommentsURL postID" 
	(8) Set the "ShopCommentsURL"  variable's postID  = to the new postID"
	(9) Replace the  "ShopCommentsURL"  in YOB_WidgetJS01.js with the updated ShopCommentsURL.
	(10) Update the GrandOldGame Server  ... with the updated version of this file ... and YOB_WidgetJS01.js in Widgets/JsCss
*/

// postID=6006627040911727495 prior=2764595108827041266  
var ShopCommentsURL = "https://www.blogger.com/comment.g?blogID=2077211053463098211&postID=6006627040911727495";

var PriorCommentsURL = "https://www.blogger.com/comment.g?blogID=2077211053463098211&postID=2764595108827041266";
 

var YOB_CommentsURL = "https://www.blogger.com/comment.g?blogID=2077211053463098211&postID=6006627040911727495";
var YOB_CommentsPath = "https://www.blogger.com/comment.g?blogID=2077211053463098211&postID=";
 
/*
set the template's redirectTraffic var = 0;
save template

Enter the comments area ... and leave

 capture the url in the browser window to set the redirect control ine SDA template html code ... i.e. http://barbershop-discussion.blogspot.com/2010/03/general-discussion-area-201001.html

reset the template's redirectTraffic var = 1
save template
*/

 var ShopCommentsPostID = new Array();
 ShopCommentsPostID[0] = "";
 ShopCommentsPostID[1] = "4158010244357839382";
 ShopCommentsPostID[2] = "3935251884048103712";
 ShopCommentsPostID[3] = "3331078729344916933";
 ShopCommentsPostID[4] = "7151023923945847445";
 ShopCommentsPostID[5] = "5799194707109921440";
 ShopCommentsPostID[6] = "2764595108827041266";
 ShopCommentsPostID[7] = "6006627040911727495";
 
 var YOB_CommentsPostID = new Array();
 YOB_CommentsPostID[0] = "6189075009434477253";
 YOB_CommentsPostID[1] = "3935251884048103712";
 YOB_CommentsPostID[2] = "3331078729344916933";
 YOB_CommentsPostID[3] = "7151023923945847445";
 YOB_CommentsPostID[4] = "5799194707109921440";
 YOB_CommentsPostID[5] = "2764595108827041266";
 YOB_CommentsPostID[6] = "6006627040911727495";
 
 var YOB_CommentsDate = new Array();
YOB_CommentsDate[0] = "11/21/09";
YOB_CommentsDate[1] = "11/23/09";
YOB_CommentsDate[2] = "04/14/10";
YOB_CommentsDate[3] = "05/11/10";
YOB_CommentsDate[4] = "08/13/10";
YOB_CommentsDate[5] = "10/23/10";
YOB_CommentsDate[5] = "03/10/11";

var YOB_Cells = YOB_CommentsPostID.length;

/*  popup list of archived comment sets ... from which user selects     */
 function YOB_GDA_Archives(x) { 
 var Obj1 = document.getElementById(x);
 Obj1.style.display="block";
  }
  
 function YOB_CloseArchives(x) { 
 var Obj1 = document.getElementById(x);
 Obj1.style.display="none";
  }
  
 function YOB_LoadArchives(x) { 
 	var TheTable = document.getElementById(x);
 	var CIndex = YOB_Cells - 1;
	var rows = Math.ceil( YOB_Cells / 4);
	for (var i=0; i<rows; i++) {
 		var newrow=TheTable.insertRow(-1);  //add new row to end of table
 		for (var j=0; j<4; j++) {
			CIndex--;
 			var newcell=newrow.insertCell(j); //insert new cell to row
 			if(CIndex >= 0) {
			newcell.innerHTML= YOB_CommentsDate[CIndex] ;
			newcell.setAttribute("onclick","YOB_A(this)");
			newcell.style.cursor = "pointer";
			}
 		} // j
 	} // i
  }
 
  /*  <td onclick="NPP_A(this)">  */
function YOB_A(x) { 
var c=x.cellIndex;
var r=x.parentNode.rowIndex;
var rIndex= YOB_Cells - ( r*4+c+ 2);
window.location.replace(YOB_CommentsPath + YOB_CommentsPostID[rIndex]);
}


 
/*
There are several ways of rounding. 
Math.round(..) round nearest whole number 
Math.ceil(..) round up 
Math.floor(..) round down
Math.abs(..)
Math.random()  produces a random real number between 0 and 1. 
*/
