/*  ***************** MasterJS01.js ********************* */

/*  *** 
Replaces BobMainTest02.js
Replaces Functions in 
	Features0212.js
	AVMaster01.js
	

*** */


/*  ***************** Global Variables ********************* */
/*

*/

/*
var SHValue; // player version index
var TGOG = 'http://www.thegrandoldgame.com/';

var FLVars = '&backcolor=FFFF99&frontcolor=666600&lightcolor=990099&screencolor=EEEEEE&autostart=true';

var SWFV = 2;  // 
var ShopIDvar;
var AVurlvar;
var PlayerID;

var player = null;
var currentState = "NONE"; 
var previousState = "NONE"; 

var SWFplayer = TGOG + SWFPF[SWFV] + '/' + SWFPlayerV[SWFV];


/* Functions
	AV(x, b, k)
	AVM(x1, x2, x3, x4, x5)
	ChangeBanner(z, PicName, SrcIndex)
	DXAV(b, k)
	getVars()
	HideAVObject(ObjectID)
	HideObject(ObjectID)
	HideUTube(ObjectID)
	IHtml(x1)
	RVMJR()
	ScrollHeightTest(a)
	ScrollHeightValue(a)
	SetAVMaster()
	SetLP(oldLP, newLP)
	SF_Display(x1, x2)
	SF_FixObject()
	ShowFBVideo(ObjectID)
	ShowOldStory(x1, x2)
	ShowStory(x1, x2)
	SP_AV(x, b, k)
	stateListener(obj)
	ToggleAV(ObjectID)
	TogglePoll(ObjectID)
 	UpdateRunIndex(x)
	ZRowBox(z, x)
	ZSLP(z, zIndex)
	ZSSP(z, XX)
	
*/
 
 /* MasterJSFeatureVars01.js replaces Non-function elements of 
	Features0212.js
	AVMaster01.js 
	
*/



/*  ***************** Global Variables ********************* */

var SWFPlayerV = new Array();
SWFPlayerV[0] = 'player.swf';
SWFPlayerV[1] = 'player.swf';
SWFPlayerV[2] = 'player.swf';
SWFPlayerV[3] = 'player-viral.swf';

var SWFPF = new Array();
SWFPF[0] = 'SWF';
SWFPF[1] = 'SWF01';
SWFPF[2] = 'SWF02';
SWFPF[3] = 'SWF03';


var SHValue; // player version index
var TGOG = 'http://www.thegrandoldgame.com/';

var FLVars = '&backcolor=FFFF99&frontcolor=666600&lightcolor=990099&screencolor=EEEEEE&autostart=true';

var SWFV = 2;  // 
var ShopIDvar;
var AVurlvar;
var PlayerID;

var player = null;
var currentState = "NONE"; 
var previousState = "NONE"; 

var SWFplayer = TGOG + SWFPF[SWFV] + '/' + SWFPlayerV[SWFV];

function HideAVObject(ObjectID) {
  if (!document.getElementById) return;
   	AVM(0, 0, 0, 1);
    obj = document.getElementById(ObjectID);
    obj.style.display = "none";
 }
 

function SetAVMaster() {
	MAVobj = document.getElementById('Master_AVX');
}

function AVM(x1, x2, x3, x4, x5) {
/*  Args 
	x1 = Shop_ID index
	x2 = File Number
	x3 = Media Type
		0 = audio
		1 = U-Tube, show video
		2 = U-Tube, audio only
		3 = Google, show video
		4 = Google. audio only 
	 
	x4 = File Group Number - default = '00', 

	x5 = 0 when x1 = ShopID, 1 when x1 = FeatureID 
	
	audio test x1=10, x2=4 x3=0, x4=0, x5=0 
	
	*/


SetAVMaster();
if(x4 == 'undefined') x4 = '00';
 else if(x4 < 10) x4 = '0' + x4;
if(x5 == 'undefined') x5 = '0'; // start value 
 if(x5 < 0) x5 = '0'; // start value 

  var AVurlvar = eval(Shop_ID[x1] + '_' + x4)[x2];
 
 PlayerID = 'Master_PID';

/* **********************************
 
 if (x4 == 'undefined') x4 = '00';
 else if (x4 < 10) x4 = '0' + x4;
 
 if (x5 != 'undefined') {} 
 
 var AVurlvar = eval(Shop_ID[x1] + '_' + x4)[x2];
 alert(AVurlvar);
 var PlayerID = 'Master_PID'; 
 
 &image=http://www.thegrandoldgame.com/RamblinWreck01a.jpg
*/

	if (x3 == 0) {
	
		var SWFh = 20;
		var SWFw = 250;
		var fileValue = '&file=http://www.thegrandoldgame.com/Audio/' + AVurlvar + FLVars + '&start=' + x5;
	}
	
	else if (x3 == 5) {
	
		var SWFh = 300;
		var SWFw = 365;
		var fileValue = '&file=/Video/' + AVurlvar + FLVars + '&start=' + x5;
	}
	
	else if (x3 < 3){
	
		var fileValue = '&file=http://www.youtube.com/v/' + AVurlvar + FLVars + '&start=' + x5;
		if (x3 == 2) { 
		
			var SWFh = 20;
			var SWFw = 250;
		}
		else {
		var SWFh = 252;
		var SWFw = 306;
		}
	}
	
	else if (x3 = 3){
	
		var SWFh = 20;
		var SWFw = 250;
		var fileValue = '&file=http://www.snuhfiles.com/sound/' + AVurlvar  + FLVars + '&start=' + x5;
	}
	
	else {
		var fileValue = '&file=http://video.google.com/googleplayer.swf?docid=' + AVurlvar  + FLVars + '&start=' + x5;
		if (x3 == 4) { 
			var SWFh = 20;
			var SWFw = 250;
		}
		else {
		var SWFh = 252;
		var SWFw = 306;
		}
	}
	
		var so = new SWFObject( SWFplayer,PlayerID,SWFw,SWFh,'9');
		so.addParam('allowscriptaccess','always');
		so.addParam('allowfullscreen','false');
		so.addParam('flashvars', fileValue);
		so.addParam('id', PlayerID);
		so.addParam('name', PlayerID);
		so.write(PlayerID);
		MAVobj.style.display = "inline";
		MAVPlayer = document.getElementById(PlayerID);
 }

function ChangeBanner(z, PicName, SrcIndex)  {
 var Pics = Images[z];
 var PicSrc  =  'http://www.thegrandoldgame.com/' + Pics[SrcIndex];
 document[PicName].src=PicSrc;
 
}

function PlatoPole(PicID, PoleID)  {
var W =  parseInt(document.getElementById(PicID).style.width);
var obj1 = document.getElementById(PoleID);
var k = W / 360.0;
obj1.style.top =  k * 78 + 'px';
obj1.style.left =  k * 74 + 'px';
obj1.style.width =  k * 20 + 'px';
obj1.style.height =  k * 70 + 'px';
obj1.style.border = "none";
}

function DXAV(b, k) {
    var AVurlvar = eval('D_AVurl[b]');
	var PlayerID = 'XAV1';
	if(k == 0) {
		var SWFh = 20;
		var SWFw = 250;
		var fileValue = '&file=http://www.thegrandoldgame.com/Audio/' + AVurlvar + '&backcolor=FFFFCC&frontcolor=0000CC&lightcolor=FFFF00&screencolor=EEEEEE&autostart=true';
	}
	else if (k == 2) {
		var SWFh = 252;
		var SWFw = 306;
		var fileValue = '&file=http://www.thegrandoldgame.com/Flash/' + AVurlvar + '&backcolor=FFFFCC&frontcolor=0000CC&lightcolor=FFFF00&screencolor=AAAA00&autostart=true';
 
	}	
	else {
		var fileValue = '&file=http://www.youtube.com/v/' + AVurlvar + '&hl=en&rel=0&border=1&backcolor=FFFFCC&frontcolor=0000CC&lightcolor=FFFF00&screencolor=EEEEEE&autostart=true';
		var SWFh = 252;
		var SWFw = 306;
	}
		var so = new SWFObject(SWFplayer,PlayerID,SWFw,SWFh,'9');
		so.addParam('allowscriptaccess','always');
		so.addParam('allowfullscreen','false');
		so.addParam('flashvars', fileValue);
		so.addParam('id', PlayerID);
		so.addParam('name', PlayerID);
		so.write(PlayerID);
	    obj = document.getElementById(PlayerID); 
		obj.style.display="inline";
				
 }

/* ****************** Function getVars ()********************* */
/* *** retrieves variables brought in href from theclipjoint (backroom) *** */

function getVars() {
SetAVMaster();

if (document.referrer == 'http://theclipjoint.blogspot.com/'){
varArray = document.location.href.split('?')[1].split('&');
	for(var x=0; x<varArray.length; x++)
	{
		var tmp = varArray[x].split('=');
		eval(unescape(tmp[0]) + '="' + unescape(tmp[1]) + '"');
	}

/* change Backroom to http: www.theoldbarbershop.com/index.html#FeatureTop?SFX1='1'&SFX2='1';" Row = SFX1, Cell = SFX2

Also ... create general discussion comment update proceedure for Backroom
 
*/	
	if(SFX1 != 0){
	SF_Display(SFX1, SFX2);
	}
	
}

}


  
 /* Never successful in stopping video using JavaScript ... tried 
 
 MAVPlayer.sendEvent('STOP'); 
 or
 MAVPlayer.Stop()
 or
 function HideAVObject(ObjectID) {
 
    obj = document.getElementById(ObjectID);
    obj.stopVideo();
    obj.style.display = "none";
 }
 
 	MAVPlayer.sendEvent(''STOP'', ''true''); 
*/

 
function HideObject(ObjectID) {
  if (!document.getElementById) return;
    AVM(0, 0, 0, 1);
    obj = document.getElementById(ObjectID);
    obj.style.display = "none";
 }
 
function HideUTube(ObjectID) {
  if (!document.getElementById) return;
    AVM(0, 0, 0, 1);
    obj = document.getElementById(ObjectID);
    obj.style.display = "none";
   
 }

function IHtml(x1){
	alert(x1);
	var var1 = 'NPPTest';
	var var2 = 'AskMissCarol01';
	var  obj1 = document.getElementById(var1);
	var var3 = obj1.height;
	alert(obj1.firstChild);
	var  obj2 = document.getElementById(var2);
	alert(obj2.firstChild);
 	var  obj2 = document.getElementById(var2).innerHTML;
	alert(obj2);
    NPP01.innerHTML = obj2;
}    

function RVMJR() {
 alert('debug function');
   }

function ScrollHeightTest(a) {

		var testObject = document.getElementById(a);
		var Hdelta = 92; 
		NewWinHeight = testObject.scrollHeight + Hdelta;
		var MaxHeight = .92 * window.screen.height;
		if(NewWinHeight > MaxHeight) NewWinHeight = MaxHeight;
		self.resizeTo(760, NewWinHeight);
}

function ScrollHeightValue(a) {
	var testObject1 = document.getElementById(a);
	var testObject = testObject1.getElementById('SF_010B');
	testObject1.style.height = testObject.scrollHeight + 'px';
	alert('style.height ' + testObject.style.height);
}


 
function SetLP(oldLP, newLP){ 
/* "SetLP" resets the background color, font color, and cursor for the selected and deselected menu items. */

     obj1 = document.getElementById(oldLP);
     obj1.style.backgroundColor = "purple";
     obj1.style.color = "white";
     obj1.style.cursor = "pointer";
     obj1.style.border = "2px ridge rgb(0, 128, 0)"
     obj2 = document.getElementById(newLP);
     obj2.style.backgroundColor = "transparent";
     obj2.style.color = "red";
     obj2.style.cursor="default";
     obj2.style.border = "0"
   }

/* ****************** SF_Display ********************* */

/* The title rows below the Feature Rows are navigational bars.  When a specific Feature is selected, its title in the Bar is changed to "Exit" and provides for closing of the currently selected Feature. 

Features can be referenced by either their "call letters" (SJA) or matrix position [(1,2) = row 1, cell 2].  

The default "displayed feature" SFX='SF_010'

*** Note: Funtion was Called HelloThere(x)

*** */

function SF_Display(x1, x2) {

var z1 = x1 - 1;  
var x = z1 * RowLength + x2;
var FTop = '#FTop' + x;
var xx = 10 * x;
var z = (DisplayedRow - 1) * RowLength + DisplayedRowCell;
var zz = 10 * z;  
var FRZ = 'FR' + DisplayedRow + DisplayedRowCell; // old FRX
var FRX = 'FR' + x1 + x2; // new FRX

if(zz < 100) var SFZ = 'SF_0' + zz; // old SFX
else var SFZ = 'SF_' + zz;
if(xx < 100) var SFX = 'SF_0' + xx; // old SFX
else var SFX = 'SF_' + xx;

DisplayedRow = x1;
DisplayedRowCell = x2; 

if(DisplayedIndex != 0) {
	var obj1 = document.getElementById(FRZ);
	var FTopLink = '<a href=' + FTop + '>' + FeatureTitles[DisplayedIndex] + '</a>';
	obj1.innerHTML = FTopLink;
	obj1 = document.getElementById(SFZ);
	obj1.style.display = "none";
	}

	if(x != DisplayedIndex){
		var FTopLink = '<a href=#FTop0>Exit Feature</a>';
		var obj1 = document.getElementById(FRX);
		obj1.innerHTML = FTopLink;
		DisplayedIndex = x;
		var obj1 = document.getElementById(SFX);
		obj1.style.display = "block"; 
	}
}

function SF_FixObject() {
	if(Fixed_MissCarol_obj1 != 1) {
	MissCarol_obj1 = document.getElementById('AskMissCarol01').innerHTML;
	Fixed_MissCarol_obj1 = 1; 
	}
}

function ShowFBVideo(ObjectID) {
  if (!document.getElementById) return;
    obj = document.getElementById(ObjectID);
    obj.style.display = "inline";
 
 }
 
function ShowOldStory(x1, x2) {
	alert('Article Not Currently Available');
}

function ShowPP(ObjectID) {
	if (!document.getElementById) return;
    obj = document.getElementById(ObjectID);
    obj.style.display = "inline";
}

function HidePP(ObjectID) {
	if (!document.getElementById) return;
    obj = document.getElementById(ObjectID);
    obj.style.display = "none";
}

function ShowGuide() {

	var GuideFile = 'FeaturesHelp01.html';
	FUrl = Fhref + 'Menu_Help/' + GuideFile;
	var WinFeatures =  'width=640, height=480, left=100, top=100, scrollbars=1';
	PopUpWin = window.open(FUrl, WinName, WinFeatures);
}

function PollGuide() {

	var GuideFile = 'PolesHelp01.html';
	FUrl = Fhref + 'Menu_Help/' + GuideFile;
	var WinFeatures =  'width=400, height=480, left=50, top=100, scrollbars=1';
	PopUpWin = window.open(FUrl, WinName, WinFeatures);
}

function ShowStory(x1, x2) {

	Fid = FeatureID[x1];
	var OldStoryUrl = eval(Fid + '_File')[x2];
	FUrl = Fhref + Fid + '/' + OldStoryUrl;
	var WinFeatures =  'width=760, height=700, scrollbars=1';
	PopUpWin = window.open(FUrl, WinName, WinFeatures);
}

function SP_AV(x, b, k) {
	var x = x + 100;
	AV(x, b, k);
}
 
function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED
 	currentState = obj.newstate; 
	previousState = obj.oldstate;
	var playerID = obj.id;
	
	var AVDiv = playerID.charAt(0) + '_AVplayer';
	alert(currentState);
	if ((currentState == "COMPLETED") || (currentState == "IDLE")){
	
	document.getElementById(AVDiv).style.display = "none";
	}
}

function ToggleAV(ObjectID) {
  if (!document.getElementById) return;
    obj = document.getElementById(ObjectID);
	if(obj.style.display != 'none') obj.style.display="none";
	else obj.style.display="inline";
 }
 
function TogglePoll(ObjectID) {
  if (!document.getElementById) return;
    obj = document.getElementById(ObjectID);
	if(obj.style.display != 'none') obj.style.display="none";
	else obj.style.display="inline";
 }
 
function UpdateRunIndex(x) { 
  z = RunIndex.length;
  RunIndex[z] = x;
  return z;
}   

 
function ZRowBox(z, x){

 var var1 = curPages[z];
 
  if(curRowbox[z] != var1) {
  curRowbox[z] = var1;
  var rowbox = x + '_RowBox';
  i = 0  
  while (i <= 1){
   i++; 
   Obj1 = document.getElementById(rowbox + i);
   if(var1 == 1) { 
   	Obj1.style.display = "none";
   }
    else { 
   /* show row 2 (pages) at top and bottom of post page and set attributes for page 1*/
  
    var ZQPR = QPRx[z];
	
	Obj1.style.display = "inline";
	
	 var v0 = parseFloat(var1);
	 var v1 = 5.0 * i + 1.0 * v0;
	 var v2 = v1 + 'em';
	 Obj1.style.width = v2;
	 var x= ZQPR[i] + 'td4';
	 var Obj2 = document.getElementById(x + 1);
	 Obj2.style.display = "inline";
     Obj2.style.backgroundColor = "transparent";
     Obj2.style.color = "red";
     Obj2.style.cursor="default"; 
	 
	  for (t = 2; t <= MaxPages[z]; t++) {
	  var Obj2 = document.getElementById(x + t);
	  if(t <= var1) { 
	   Obj2.style.display = "inline";
       Obj2.style.backgroundColor = "purple";
       Obj2.style.color = "white";
       Obj2.style.cursor = "pointer";
	  } 
	  
      else Obj2.style.display = "none";
	
	  	 } /*  End for (t = 2; t <= MaxPages; t++) */  
		 
    } /*  End else (curPages != 1) */
	
  } /*  End for (i = 1; i <= 2; i++) */

 } /*  End if(curRowbox != curPages) */

 } /*  End RowBox(x) Function */
 
function ZSLP(z, zIndex){
  var ZQPR = QPRx[z];
 
   for (ii = 2; ii >= 1; ii--) {
   var SP = ZQPR[ii] + 'td4';
   var oldSP = SP + PIndex[z];
   var newSP = SP + zIndex;
   SetLP(oldSP, newSP);
  }
  
  curPage[z].style.display = "none";
  isNewArticle[z] = 0;
  curPage[z] = document.getElementById(curArtID[z] + zIndex);
  curPage[z].style.display = "inline";  
  oldPIndex[z] = zIndex;
    
 /* 'R_row1', the bottom table supporting article menu bar, is first shown when the last page of the lead post is selected ... with the lead post selection shown as "Home" */
var DebugX = 0;
if(DebugX){
alert('z ' + z); 
alert('RunIndex ' + RunIndex[z]);
alert('RunIndex2 ' + RunIndex2[z]);
alert('RI2 ' + RI2[z]);
alert('QPRx ' + QPRx[z]);
alert('MaxPages ' + MaxPages[z]);
alert('Mrgb ' + Mrgb[z]);
alert('curPage ' + curPage[z]);
alert('curArticle ' + curArticle[z]);
alert('Row1Index ' + Row1Index[z]);
alert('oldRow1Index ' + oldRow1Index[z]);
alert('PIndex ' + PIndex[z]);
alert('oldPIndex ' + oldPIndex[z]);
alert('isNewArticle ' + isNewArticle[z]);
alert('LeadPostID ' + LeadPostID[z]);
alert('curPages ' + curPages[z]);
alert('curRowbox ' + curRowbox[z]);
alert('curArtID ' + curArtID[z]);
alert('DateNode ' + DateNode[z]);
alert('TA ' + TA[z]);
alert('Wrap0 ' + Wrap0[z]);
alert('Wrap1 ' + Wrap1[z]);
alert('Table ' + Table[z]);
alert('Prow1 ' + Prow1[z]);
alert('Rrow1 ' + Rrow1[z]);
alert('BAddress ' + BAddress[z]);
alert('Articles ' + Articles[z]);
alert('Images ' + Images[z]);
alert('AVPlay ' + AVPlay[z]);
alert('AVPos ' + AVPos[z]);
}

 if(Articles[z] > 1) {
  if((LeadPostID[z] == curArtID[z]) && (zIndex = curPages[z])){
  var zRowBox = RunIndex[z] + '_RowBox2';
  var ztd0 = RunIndex2[z] + '_td0';
    
  document.getElementById(zRowBox).style.position ="absolute";
  Obj1 = document.getElementById(Rrow1[z]);
  Obj1.style.display = "inline";
  obj2 = document.getElementById(ztd0);
  obj2.style.backgroundColor = "transparent";
  obj2.style.color = "red";
  obj2.style.cursor = "default"; 
  obj2.style.border = "0";
 }
 }
PIndex[z] = zIndex;
}


/*  until a supporting article is selected, (TA = 0) ... top menu bar is displayed with TA set = 1.  When "Home" is selected, is reset = 0. */

function ZSSP(z, XX){
 var zk = Row1Index[z];
 var obj1 = null;
 var obj2 = null;
if(XX == 0) {
	var rowbox = RunIndex[z] + '_RowBox2'; 
	document.getElementById(rowbox).style.position ="relative";
	}

if(LeadPostID[z] == curArtID[z]){
  Obj1 = document.getElementById(Prow1[z]);
  Obj1.style.display = "inline";
  var td0 = RunIndex[z] + '_td0';
  obj2 = document.getElementById(td0);
  obj2.style.backgroundColor = "transparent";
  obj2.style.color = "red";
  obj2.style.cursor = "default"; 
  obj2.style.border = "0";
	}

/*  use "SetLP" to reset row 2 values ... page 1 selected both tables*/
  var ZQPR = QPRx[z];
  for (ii = 1; ii <= 2; ii++) {
  
   var oldSSP = ZQPR[ii] + 'td4' + oldPIndex[z];
   var newSSP = ZQPR[ii] + 'td41';
   SetLP(oldSSP, newSSP);
   if(TA[z] == 0) {
      document.getElementById(Prow1[z]).style.display = "block";
	TA[z] = 1;
   }
   var oldSSP = ZQPR[ii] + 'td' + zk;
   var newSSP = ZQPR[ii] + 'td' + XX;
   SetLP(oldSSP, newSSP);
  }

  /*  hide (display:none) for old article and active page and reveal (display:block) for new article ... (display:inline) for page one of the article*/

  curArticle[z].style.display = "none";
  curPage[z].style.display = "none";
  oldRow1Index[z] = zk;
  Row1Index[z] = XX;
  
/* ...................... Selected Article's variables ........................
  sk[0] = Titles (article title)
  sk[1] = Js (Author)
  sk[2] = Ds (article date)
  sk[3] = IDs (id of containing element)
  sk[4] = gs (pages in article)
  sk[5] = On (1= active article, 0 = inactive)
  sk[6] = Size (font size of article title)
  sk[7] = TitleRow (name of title containing element) 
  sk[8] = cIDs (name of Organization i.e. The Shop)    
*/ 

  var BURL = BAddress[z] + '(XX, z)';
  eval(BURL);
  sk = RI2[z];
 
 var ObjTitle = sk[0] + " - " + sk[1];
 
 curPages[z] = sk[4];
 curArtID[z] = sk[3];
 var CAID = sk[3] 
 
 /* ...................End Post Specific Block ........................ */  
   
 /* ...................... Article Title ........................ */

 obj2 = document.getElementById(sk[7]);
 obj2.style.display = "block";
 obj2.firstChild.nodeValue = ObjTitle;
 curArticle[z] = document.getElementById(CAID);
 curArticle[z].style.display = "block";
 curPage[z] = document.getElementById(CAID + 1);
 curPage[z].style.display = "inline";
 for (i = 2; i <= sk[4]; i++) {
  document.getElementById(CAID + i).style.display = "none"; 
 }
 
obj2.style.fontSize = sk[6]; 
 
 /* ....................... End Article Title ........................ */
 
  oldPIndex[z] = PIndex[z];
  
  PIndex[z] = 1;
Obj1 = document.getElementById(Wrap0[z]);
Obj2 = document.getElementById(Table[z]);

 if (XX == 0) {
   	Obj1.style.backgroundColor = "transparent";
	Obj1.style.border = "0";
	Obj2.style.backgroundColor = "transparent";
 	}
 else if (oldRow1Index[z] == 0)  {
    Obj1.style.border = '2px solid red';
	Obj1.style.backgroundColor = Mrgb[z];
 	Obj2.style.backgroundColor = Mrgb[z];
 	}

  if(TA[z] == 0){
  TA[z] = 1;
  }	  
  else if(XX == 0) {
  /*  If "home" is selected, user is returned to "lead post"  */
  document.getElementById(Rrow1[z]).style.display = "none";
  document.getElementById(Prow1[z]).style.display = "none";
  }
 else {
  var ZQPR = QPRx[z];
  var DNx = ZQPR[1] + 'DN' + XX;
   	obj1 = document.getElementById(DNx);
    obj1.style.display = "block";
    obj1.firstChild.nodeValue = sk[2];
 	}
 
 /*  If the number of pages in the selected article (curpages) is different from the number in the previously selected article (oldCurrentPages), run the "Rowbox" module. */

 ZRowBox(z, RunIndex[z]);
 document.getElementById(Wrap1[z]).style.display = "inline";
}
 