	//NOTE: To move tabs up or down, change startFrom, startTo, areaTop, white tab height, and storyboard heights.
	var startFrom = 110;
	var startTo = -85;
	var currTab = 0;
	var tabTop = [0,40,80,120,160,200,240,280,320,360];
	var storyOpen = false;
	var currStory=10;
	
	var animations = [];
	var animationCount = 0;
	
	var areaTop = 115; // FOR IMAGE MAPS
	
	//var tabsActive = true;
	
	function slideUp(o,value) {
	  o.style.marginTop = value+'px';
	}
	
	function slideOver(p,value){
		p.style.marginLeft = value+'px';
		reValue = Math.abs(value);
		p.style.clip='rect(0px,900px,255px,'+reValue+'px)';
	}
	
	function slideStory(p,value){
		p.style.marginLeft = value+'px';
	}
	
	function nextAnimation() {
	  if (animations[animationCount]) {
		// writeDebug('starting animation '+animationCount);
		animations[animationCount].start();
		animationCount++;
	  }else{ //clean up animations array
		animations.length=0;
		animationCount=0;
	  }
	}
	
	//////////////////////////////////
	////////// ON PAGE LOAD //////////
	//////////////////////////////////
	function previewNavigation(){
		animations.push(new Animation({
		  from: startFrom,
		  to: startTo,
		  ontween: function(value){
			oBox=document.getElementById('tab0');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[1],
		  to: startTo+tabTop[1],
		  ontween: function(value){
			oBox=document.getElementById('tab1');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[2],
		  to: startTo+tabTop[2],
		  ontween: function(value){
			oBox=document.getElementById('tab2');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[3],
		  to: startTo+tabTop[3],
		  ontween: function(value){
			oBox=document.getElementById('tab3');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[4],
		  to: startTo+tabTop[4],
		  ontween: function(value){
			oBox=document.getElementById('tab4');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[5],
		  to: startTo+tabTop[5],
		  ontween: function(value){
			oBox=document.getElementById('tab5');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[6],
		  to: startTo+tabTop[6],
		  ontween: function(value){
			oBox=document.getElementById('tab6');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		animations.push(new Animation({
		  from: startFrom+tabTop[7],
		  to: startTo+tabTop[7],
		  ontween: function(value){
			oBox=document.getElementById('tab7');
			slideUp(oBox,value);
		  },
		  oncomplete: nextAnimation
		}));
		
		if(tabmaxnum>8){
			animations.push(new Animation({
			  from: startFrom+tabTop[8],
			  to: startTo+tabTop[8],
			  ontween: function(value){
				oBox=document.getElementById('tab8');
				slideUp(oBox,value);
			  },
			  oncomplete: nextAnimation
			}));
		}
		
		if(tabmaxnum>9){
			animations.push(new Animation({
			  from: startFrom+tabTop[9],
			  to: startTo+tabTop[9],
			  ontween: function(value){
				oBox=document.getElementById('tab9');
				slideUp(oBox,value);
			  },
			  oncomplete: nextAnimation
			}));
		}
		nextAnimation();
	}
	
	function setNavigation(){
		if(section<10){
			for(i=0; i<tabmaxnum; i++){
				if(i<section){
					var currTop = startTo+tabTop[i];
				}else{
					var currTop = startFrom+tabTop[i];
					tabOpen[i]=true;
				}
				var tabRef = "tab"+i;
				document.getElementById(tabRef).style.marginTop=currTop+"px";
			}
			var newMapRef="#tabbuttonmap"+section;
			document.getElementById('imgbutton').useMap=newMapRef;
		}
	}
	
	//////////////////////////////////////////////
	//////////// ROLLOVER TABS ///////////////////
	//////////////////////////////////////////////
	var myTimer = setTimeout('doNothing()',10);
	//var tabOpen = [false,false,false,true,true,true,true,true];
	var tabOpen = [false,false,false,false,false,false,false,false,false,false];
	for(i=0;i<tabmaxnum;i++){
		if(i>=section){
			tabOpen[i]=true;
		}
	}
	function doNothing(){ }
	
	function stopTimeout(currTab){
		if(tabOpen[currTab]==true){
			clearTimeout(myTimer);
		}else{
			
		}
	}
	
	function rollOn(tabnum){
		clearTimeout(myTimer);
		var storyRef = 'story'+tabnum;
		if(tabnum!=currStory && currStory<10){
			currStoryRef = "story"+currStory
			closeStory(currStoryRef);
		}
		currStory=tabnum;
		openStory(storyRef);
		if(tabOpen[tabnum]==true && tabnum>0){
			var tabmaxminus = tabmaxnum-1;
			var thisMinTab = tabmaxminus;
			for(n=tabmaxminus;n>=0;n--){
				if(tabOpen[n]==true){ //make sure this runs only once
					thisMinTab=n;
				}
			}
			tabsUp(thisMinTab,tabnum);
		}else{
			tabsDown(tabnum);
		}
		var newMapRef="#tabbuttonmap"+tabnum;
		document.getElementById('imgbutton').useMap=newMapRef;
	}
	
	function rollOff(tabnum,tabmax){
		var storyRef = 'story'+tabnum;
		if(tabnum<section){
			myTimer = setTimeout(function(){tabsUp(tabnum,section);closeStory(storyRef);resetCurrStory();},10);
		}else{
			myTimer = setTimeout(function(){tabsDown(section);closeStory(storyRef);resetCurrStory();},10);
		}
	}
	function resetCurrStory(){
		currStory=10;
		var newMapRef="#tabbuttonmap"+section;
		document.getElementById('imgbutton').useMap=newMapRef;
	}
	
	function tabsDown(tabnum){
		clearTimeout(myTimer);
		currTab=tabnum;
		if(tabnum<=0 && tabOpen[0]==false){
			animations.push(new Animation({
				from: startTo,
				to: startFrom,
				ontween: function(value){
					oBox=document.getElementById('tab0'); 
					slideUp(oBox,value);
				},
			}));
			tabOpen[0]=true;
		}
		if(tabnum<=1 && tabOpen[1]==false){
			animations.push(new Animation({
				from: startTo+tabTop[1],
				to: startFrom+tabTop[1],
				ontween: function(value){
					oBox=document.getElementById('tab1');
					slideUp(oBox,value);
				},
			}));
			tabOpen[1]=true;
		}
		if(tabnum<=2 && tabOpen[2]==false){
			animations.push(new Animation({
				from: startTo+tabTop[2],
				to: startFrom+tabTop[2],
				ontween: function(value){
					oBox=document.getElementById('tab2');
					slideUp(oBox,value);
				},
			}));
			tabOpen[2]=true;
		}
		if(tabnum<=3 && tabOpen[3]==false){
			animations.push(new Animation({
				from: startTo+tabTop[3],
				to: startFrom+tabTop[3],
				ontween: function(value){
					oBox=document.getElementById('tab3');
					slideUp(oBox,value);
				},
			}));
			tabOpen[3]=true;
		}
		if(tabnum<=4 && tabOpen[4]==false){
			animations.push(new Animation({
				from: startTo+tabTop[4],
				to: startFrom+tabTop[4],
				ontween: function(value){
					oBox=document.getElementById('tab4');
					slideUp(oBox,value);
				},
			}));
			tabOpen[4]=true;
		}
		if(tabnum<=5 && tabOpen[5]==false){
			animations.push(new Animation({
				from: startTo+tabTop[5],
				to: startFrom+tabTop[5],
				ontween: function(value){
					oBox=document.getElementById('tab5');
					slideUp(oBox,value);
				},
			}));
			tabOpen[5]=true;
		}
		if(tabnum<=6 && tabOpen[6]==false){
			animations.push(new Animation({
				from: startTo+tabTop[6],
				to: startFrom+tabTop[6],
				ontween: function(value){
					oBox=document.getElementById('tab6');
					slideUp(oBox,value);
				},
			}));
			tabOpen[6]=true;
		}
		if(tabnum<=7 && tabOpen[7]==false){
			animations.push(new Animation({
				from: startTo+tabTop[7],
				to: startFrom+tabTop[7],
				ontween: function(value){
					oBox=document.getElementById('tab7');
					slideUp(oBox,value);
				}, 
			}));
			tabOpen[7]=true;
		}
		if(tabmaxnum>8){
			if(tabnum<=8 && tabOpen[8]==false){
				animations.push(new Animation({
					from: startTo+tabTop[8],
					to: startFrom+tabTop[8],
					ontween: function(value){
						oBox=document.getElementById('tab8');
						slideUp(oBox,value);
					}, 
				}));
				tabOpen[8]=true;
			}
		}
		if(tabmaxnum>9){
			if(tabnum<=9 && tabOpen[9]==false){
				animations.push(new Animation({
					from: startTo+tabTop[9],
					to: startFrom+tabTop[9],
					ontween: function(value){
						oBox=document.getElementById('tab9');
						slideUp(oBox,value);
					}, 
				}));
				tabOpen[9]=true;
			}
		}
		
		for(n=tabnum;n<=tabmaxnum;n++){
			nextAnimation();	
		}
	}
	
	////////////////////////////////////////////////
	//////////////// ROLL OFF //////////////////////
	////////////////////////////////////////////////
	function tabsUp(tabnum){
		myTimer = setTimeout(function(){tabsUpNow(tabnum)},20);
	}
	
	function tabsUp(tabnum,tabmax){
		if(tabnum<=0 && tabmax>0){
			animations.push(new Animation({
				from: startFrom,
				to: startTo,
				ontween: function(value){
					oBox=document.getElementById('tab0');
					slideUp(oBox,value);
				},
			}));
			tabOpen[0]=false;
		}
		if(tabnum<=1 && tabmax>1){
			animations.push(new Animation({
				from: startFrom+tabTop[1],
				to: startTo+tabTop[1],
				ontween: function(value){
					oBox=document.getElementById('tab1');
					slideUp(oBox,value);
				},
			}));
			tabOpen[1]=false;
		}
		if(tabnum<=2 && tabmax>2){
			animations.push(new Animation({
				from: startFrom+tabTop[2],
				to: startTo+tabTop[2],
				ontween: function(value){
					oBox=document.getElementById('tab2');
					slideUp(oBox,value);
				},
			}));
			tabOpen[2]=false;
		}
		if(tabnum<=3 && tabmax>3){
			animations.push(new Animation({
				from: startFrom+tabTop[3],
				to: startTo+tabTop[3],
				ontween: function(value){
					oBox=document.getElementById('tab3');
					slideUp(oBox,value);
				},
			}));
			tabOpen[3]=false;
		}
		if(tabnum<=4 && tabmax>4){
			animations.push(new Animation({
				from: startFrom+tabTop[4],
				to: startTo+tabTop[4],
				ontween: function(value){
					oBox=document.getElementById('tab4');
					slideUp(oBox,value);
				},
			}));
			tabOpen[4]=false;
		}
		if(tabnum<=5 && tabmax>5){
			animations.push(new Animation({
				from: startFrom+tabTop[5],
				to: startTo+tabTop[5],
				ontween: function(value){
					oBox=document.getElementById('tab5');
					slideUp(oBox,value);
				},
			}));
			tabOpen[5]=false;
		}
		if(tabnum<=6 && tabmax>6){
			animations.push(new Animation({
				from: startFrom+tabTop[6],
				to: startTo+tabTop[6],
				ontween: function(value){
					oBox=document.getElementById('tab6');
					slideUp(oBox,value);
				},
			}));
			tabOpen[6]=false;
		}
		if(tabnum<=7 && tabmax>7){
			animations.push(new Animation({
				from: startFrom+tabTop[7],
				to: startTo+tabTop[7],
				ontween: function(value){
					oBox=document.getElementById('tab7');
					slideUp(oBox,value);
				},
			}));
			tabOpen[7]=false;
		}
		if(tabmaxnum>8){
			if(tabnum<=8 && tabmax>8){
				animations.push(new Animation({
					from: startFrom+tabTop[8],
					to: startTo+tabTop[8],
					ontween: function(value){
						oBox=document.getElementById('tab8');
						slideUp(oBox,value);
					},
				}));
				tabOpen[8]=false;
			}
		}
		if(tabmaxnum>9){
			if(tabnum<=9 && tabmax>9){
				animations.push(new Animation({
					from: startFrom+tabTop[9],
					to: startTo+tabTop[9],
					ontween: function(value){
						oBox=document.getElementById('tab9');
						slideUp(oBox,value);
					},
				}));
				tabOpen[9]=false;
			}
		}
		for(n=tabnum;n<=tabmax;n++){
			nextAnimation();	
		}
		if(tabmax==10){
			var newMapRef="#tabbuttonmap10";
			document.getElementById('imgbutton').useMap=newMapRef;
		}
	}
	
	//////////////////////////////////////////////
	//////////// STORY ANIMATIONS ////////////////
	//////////////////////////////////////////////
	function openStory(story){
		if(storyOpen==false){	
			storyOpen=true;
			animations.push(new Animation({
				from: -900,
				to: 0,
				ontween: function(value){
					pBox=document.getElementById(story);
					slideOver(pBox,value);
				}, 
			}));
			nextAnimation();
		}
	}
	function closeStory(story){
		storyOpen=false;
		animations.push(new Animation({
			from: 0,
			to: -900,
			ontween: function(value){
				pBox=document.getElementById(story);
				slideOver(pBox,value);
			},
			oncomplete: function(){
				sliderRef = 'storyinner'+story.substr(5);
				resetStorySlider(sliderRef);
			}
		}));
		nextAnimation();
	}
	function storyFore(storyslider){
		var storyNum=storyslider.substr(10);
		var currFrom=storyLeft[storyNum];
		var currTo=currFrom-750;  //was -650
		animations.push(new Animation({
			from: currFrom,
			to: currTo,
			ontween: function(value){
				pBox=document.getElementById(storyslider);
				slideStory(pBox,value);
			}, 
		}));
		nextAnimation();
		var storyBackRef="storyarrowback"+storyNum;
		var storyForeRef="storyarrowfore"+storyNum;
		storyLeft[storyNum]=storyLeft[storyNum]-750;  //was -650
		document.getElementById(storyBackRef).style.display="block";
		if(storyWidth[storyNum]+storyLeft[storyNum]<750){  //was 680
			document.getElementById(storyForeRef).style.display="none";
		}
	}
	function storyBack(storyslider){
		var storyNum=storyslider.substr(10);
		var currFrom=storyLeft[storyNum];
		var currTo=currFrom+750;
		animations.push(new Animation({
			from: currFrom,
			to: currTo,
			ontween: function(value){
				pBox=document.getElementById(storyslider);
				slideStory(pBox,value);
			}, 
			oncomplete: function(){
				document.getElementById(storyForeRef).style.display="block";
			},
		}));
		nextAnimation();
		var storyBackRef="storyarrowback"+storyNum;
		var storyForeRef="storyarrowfore"+storyNum;
		storyLeft[storyNum]=storyLeft[storyNum]+750;
		
		if(storyLeft[storyNum]>=0){
			document.getElementById(storyBackRef).style.display="none";
		}
	}
	function resetStorySlider(sliderRef){
		document.getElementById(sliderRef).style.marginLeft = '0px';
		//document.getElementById(sliderRef).style.clip = 'rect(0px,900px,220px,0px)';
		var storyNum=sliderRef.substr(10);
		storyLeft[storyNum]=0;
		var storyBackRef="storyarrowback"+storyNum;
		document.getElementById(storyBackRef).style.display="none";
		var storyForeRef="storyarrowfore"+storyNum;
		if(storyWidth[storyNum]>660){
			document.getElementById(storyForeRef).style.display="block";
		}
	}
	function showStoryText(storyTextRef){
		document.getElementById(storyTextRef).style.display="block";
	}
	function hideStoryText(storyTextRef){
		document.getElementById(storyTextRef).style.display="none";
	}
	
	//////////////////////////////////////////////
	//////////// PAGE ANIMATIONS /////////////////
	//////////////////////////////////////////////
	var currPagePos = 0;
	function nextPage(){
		document.getElementById('callout').innerHTML="";
		animations.push(new Animation({
			from: currPagePos,
			to: currPagePos-740,
			ontween: function(value){
				oBox=document.getElementById('copyboard');
				slideStory(oBox,value);
			},
			oncomplete: function(){
				currPagePos = currPagePos-740;
				copywidth=document.getElementById("copyboard").offsetWidth;
				if((copywidth-740) <= Math.abs(currPagePos)){ document.getElementById('copyarrow_fore').style.display="none"; }
				document.getElementById('copyarrow_back').style.display="block";
				if(callouts.length>0){
					doCallOut(currPagePos);
				}
			}
		}));
		nextAnimation();
		
	}
	
	function doCallOut(currPagePos){
		var calloutString="";
		var absPagePos = Math.abs(currPagePos);
		for(var n=0;n<callouts.length;n++){
			if(calloutpos[n]==absPagePos || calloutpos[n]==absPagePos+370){
				calloutString=calloutString+callouts[n]+"<br>&nbsp;<br>";
			}
		}
		document.getElementById('callout').innerHTML=calloutString;
	}
	
	function prevPage(){
		document.getElementById('callout').innerHTML="";
		animations.push(new Animation({
			from: currPagePos,
			to: currPagePos+741,   //0 causes error for some reason....
			ontween: function(value){
				oBox=document.getElementById('copyboard');
				slideStory(oBox,value);
			},
			oncomplete: function(){
				currPagePos=currPagePos+740;
				document.getElementById("copyboard").style.marginLeft=currPagePos+"px";
				if(currPagePos==0){ document.getElementById('copyarrow_back').style.display="none"; }
				document.getElementById('copyarrow_fore').style.display="block";
				if(callouts.length>0){
					doCallOut(currPagePos);
				}
			}
		}));
		nextAnimation();
	}
	
	//////////////////////////////////////////////
	//////////// BANNER AD ANIMATIONS ////////////
	//////////////////////////////////////////////
	function openAd(adwidth){
		animations.push(new Animation({
			from: 1093,
			to: 1093-adwidth, 
			ontween: function(value){
				oBox=document.getElementById('fullpagead');
				slideStory(oBox,value);
			},
			oncomplete: function(){
				
			}
		}));
		nextAnimation();
		
	}
	
	function closeAd(adwidth){
		animations.push(new Animation({
			from: 1093-adwidth,
			to: 1093, 
			ontween: function(value){
				oBox=document.getElementById('fullpagead');
				slideStory(oBox,value);
			},
			oncomplete: function(){
				
			}
		}));
		nextAnimation();
		
	}
	
	//////////////////////////////////////////////
	//////////// WRITE NAV TABS //////////////////
	//////////////////////////////////////////////
	function writeNavTabs(){
		var currIndex = 120;
		document.writeln('<div id="navTabWrapper">');
		for(i=0; i<tabmaxnum; i++){
			var tabRef = "tab"+i;
			document.writeln('<div id="'+tabRef+'" class="outer" style="margin-top:'+(startFrom+tabTop[i])+'px; z-index:'+currIndex+';">');
			document.writeln('<div class="upper" style="background-color:#'+currColor[i]+'; z-index:'+(currIndex+1)+';"></div>');
			document.writeln('<div class="lower" style="border-top-color:#'+currColor[i]+'; z-index:'+(currIndex+1)+';"></div>');
			document.writeln('<div class="text" style="z-index:'+(currIndex+2)+';">'+currText[i]+'</div>');
			document.writeln('</div>');
			currIndex=currIndex-10;
		}
		document.writeln('</div>');
	} 
	
	function writeNavTabMaps(){
		var y1=0;
		var y2=0;
		var y3=0;
		var y4=0;
		for(n=0;n<tabmaxnum;n++){
			currTop=areaTop;
			var mapRef="tabbuttonmap"+n;
			document.writeln('<map name="'+mapRef+'">');
			for(i=0;i<tabmaxnum;i++){
				y1=currTop+40;
				y2=currTop;
				if(i==n){
					y3=y2+230;
					y4=y1+230;
				}else{
					y3=y2+tabTop[1]; //tabTop[1] is first gap between tabs, e.g. tab height when closed
					y4=y1+tabTop[1];
				}
				var tabRef = "tab"+i;
				document.writeln('<area shape="poly" coords="0,'+y1+',40,'+y2+',40,'+y3+',0,'+y4+'" href="#" onMouseOver="rollOn('+(i)+');" onMouseOut="rollOff('+(i)+','+tabmaxnum+');" />');
				if(i==n){ currTop+=230; }else{ currTop+=tabTop[1]; }
			}
			document.writeln('</map>');
		}
	}
	
	function writeMainNavTabMap(){
		var y1=0;
		var y2=0;
		var y3=0;
		var y4=0;
		currTop=areaTop;
		var mapRef="tabbuttonmap10";
		document.writeln('<map name="'+mapRef+'">');
		for(i=0;i<tabmaxnum;i++){
			y1=currTop+40;
			y2=currTop;
			y3=y2+tabTop[1];
			y4=y1+tabTop[1];
			var tabRef = "tab"+i;
			document.writeln('<area shape="poly" coords="0,'+y1+',40,'+y2+',40,'+y3+',0,'+y4+'" href="#" onMouseOver="rollOn('+(i)+');" onMouseOut="rollOff('+(i)+','+tabmaxnum+');" />');
			currTop+=tabTop[1];
			}
		document.writeln('</map>');
	}
	
	var storyWidth = [];
	var storyLeft = [];
		
	function writeStories(){
		if (navigator.appName=='Microsoft Internet Explorer'||navigator.appName=='Opera'){ isIE=true; }else{ isIE=false; }
		for(i=0;i<tabmaxnum;i++){
			storyWidth[i]=0;
			storyLeft[i]=0;
		}
		var currIndex = 20;
		var currTab = 0;
		for(n=0;n<storymaxnum;n++){
			if(currTab<storyList[n][1]){  //time to start a new storyboard
				if(currTab>0){ //close out old storyboard if this is not the first storyboard
					document.writeln('</div>');  // close inner story div
					document.writeln('</div>');  // close outer story div
					if(storyWidth[currTab-1]<=720){ // set visibility of arrows for previous storyboard (still old currTab)
						document.getElementById(storyArrowForeRef).style.display="none";
						document.getElementById(storyboardRef).style.width=(storyWidth[currTab-1]+80)+"px"; // set previous storyboard width if it is shorter than max
					}
					if(isIE==true){ document.getElementById(storyBackgrndRef).style.width=Math.ceil(storyWidth[currTab-1]/720)*900;
					}else{ document.getElementById(storyBackgrndRef).style.width=(storyWidth[currTab-1]+160)+"px"; }
				}
				var storyboardRef = "story"+currTab;  // note that storyboardRef must start with 0 but tabID is 1
				var storyInnerRef = "storyinner"+currTab;
				var currTop = areaTop+tabTop[currTab];
				var storyArrowForeRef = "storyarrowfore"+currTab;
				var storyArrowBackRef = "storyarrowback"+currTab;
				var storyBackgrndRef = "storybackgrnd"+currTab;
				var storyColor = currColor[currTab];
				document.writeln('<div id="'+storyboardRef+'" class="storyboard" onMouseOver="stopTimeout('+currTab+');" onMouseOut="rollOff('+currTab+','+tabmaxnum+');" style="top:'+currTop+'px; z-index:'+currIndex+';">'); // BEGIN OUTER DIV
				document.writeln('<div id="'+storyArrowForeRef+'" class="storyarrow_fore" style="background-color:#'+storyColor+';"><img src="images/storyarrow_fore.png" width="48" height="200" border="0" alt="next story" onMouseUp="storyFore(&quot;'+storyInnerRef+'&quot;);"></div>');
				document.writeln('<div id="'+storyArrowBackRef+'" class="storyarrow_back" style="background-color:#'+storyColor+';"><img src="images/storyarrow_back.png" width="48" height="200" border="0" alt="previous story" onMouseUp="storyBack(&quot;'+storyInnerRef+'&quot;);"></div>');
				document.writeln('<div id="'+storyInnerRef+'" class="storyslider">'); // BEGIN INNER DIV
				currTab=currTab+1;
				currIndex=currIndex-1;
				var storyContentRef = "storycontent"+n;
				document.writeln('<div id="'+storyContentRef+'" class="storycontent" >');
				document.writeln('<a href="article.php?id='+storyList[n][0]+'" class="storytitle">'+storyList[n][2]+'</a>');
				document.writeln('<a href="article.php?id='+storyList[n][0]+'"><img src="images/'+storyList[n][3]+'" width="212" height="163" border="0" class="storyphoto"></a>');
				document.writeln('</div>');  // close story content div
				document.writeln('<div id="'+storyBackgrndRef+'" class="storybckgrnd" style="background-color:#'+storyColor+'; "></div>');
				storyWidth[currTab-1]+=240; //MUST CHANGE NUMBER if you change width of storycontent div in css
			}else{
				var storyContentRef = "storycontent"+n;
				document.writeln('<div id="'+storyContentRef+'" class="storycontent" >');
				document.writeln('<a href="article.php?id='+storyList[n][0]+'" class="storytitle">'+storyList[n][2]+'</a>');
				document.writeln('<a href="article.php?id='+storyList[n][0]+'"><img src="images/'+storyList[n][3]+'" width="212" height="163" border="0" class="storyphoto"></a>');
				document.writeln('</div>');  // close story content div
				storyWidth[currTab-1]+=240; //MUST CHANGE NUMBER if you change width of storycontent div in css
			}
		}
		document.writeln('</div>');  // close very last inner story div
		document.writeln('</div>');  // close very last outer story div
		if(storyWidth[currTab-1]<=720){ // set visibility of arrows for very last storyboard
			document.getElementById(storyArrowForeRef).style.display="none";
			document.getElementById(storyboardRef).style.width=(storyWidth[currTab-1]+80)+"px";
		}
		if(isIE==true){ document.getElementById(storyBackgrndRef).style.width=Math.ceil(storyWidth[currTab-1]/720)*900;
		}else{ document.getElementById(storyBackgrndRef).style.width=(storyWidth[currTab-1]+180)+"px"; }
	}
	

	
	
	
    

