function emc(s1,s2,s3){

document.write('<A HREF="mailto:'+s3+'@'+s1+'">'+s2+'</A>');}

function emcc(s1,s2,s3,c){

document.write('<A href="mailto:'+s3+'@'+s1+'" STYLE="color:'+c+'">'+s2+'</A>');}

function emc1(s1,s2,s3){

document.write('<A  CLASS=DKCLR href="mailto:'+s3+'@'+s1+'">'+s2+'</A>');} 

function emug(s1,s2,s3){

document.write('<div><a href="mailto:'+s2+'@'+s1+'"><img src="'+s3+'" border=0 height=96 width=84></A></div>');}



function 	SetRightColOff(){

doRightCol=false;} 

function 	SetWelcome(){

//document.body.style.backgroundColor = "#cccc88";	

isWelcome=true;} 



//*** PARAMETERS and INITIALIZATION ***

var textOut='';

var debugOut=false;

// debugOut=true;

var eTA='';



// PAGE DISPLAY +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var doRightCol=true;

var isWelcome=false;

var zL=0, pL=4, curW=18;



// BANNER AND FEATURE ANIMATION +++++++++++++++++++++++++++++++++++++++++++++++

var theTimeout;

var timestruct;

var speed=1;

var ctrlsUp=0;

var direction=1;

var loopticks=50; //check status 20 times per second   

var ctrlsUp=false;  

var ctrlsUpLag=5000; //wait to post controls   

var ctrlsUpTime=0; //when cntls go up   

var freq=10000; //display each ad for 10 seconds   

var displaytime=0;    



var raceLeadDays=55; 

var dayTicks=1000*60*60*24; 



var ctrlImage=new Array();

var ftrImage=new Array();

var banImage=new Array();

var banOrder=new Array();

var banLink=new Array();

var ctrlLabel=["prev","pause","next"];

var mData=[

	[16,"About&nbsp;the&nbsp;Club",[1,"Welcome","welcome.htm"],[1,"How to Join","join.htm"],[1,"History","aboutPARC.htm"],[1,"Affiliations","affiliations.htm"],[1,"Discounts","discounts.htm"],[1,"Membership","membership.htm"],[1,"Board","governance.htm"]],

	[151,"Club Activities",[1,"Mon&nbsp;Night&nbsp;Run","monday.htm"],[1,"Tue&nbsp;Night&nbsp;Intervals","tuesday.htm"],[1,"Wed&nbsp;Night&nbsp;Run","wednesday.htm"],[1,"Thu&nbsp;Night&nbsp;Hill Repeats","thursday.htm"],[1,"Sat&nbsp;Morning Run","saturday.htm"],[1,"Monthly&nbsp;Trail&nbsp;Run","trailrun.htm"],[2,"Next&nbsp;Trail&nbsp;Run","trailnext.htm"],[0],[1,"Anniversary&nbsp;Party","aparty.htm"],[1,"Holiday&nbsp;Party","hparty.htm"]],

	[285,"Resources",[1,"Links","running_links.htm"],[1,"Places&nbsp;to&nbsp;Run","local_runs.htm"],[1,"Website","website.htm"],[2,"Feedback","mailto:wordcrank@yahoo.com"],[1,"Brochure","brochure.htm"]],

	[-158,"&nbsp;&nbsp;Activities&nbsp;Calendar","calendar.htm"],

	[-158,"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How&nbsp;to&nbsp;Join","join.htm"]];

var htj=mData.length-2;



var mMo=[0,0,0,0,0];

var mSo=[0,0,0,0,0];

var mMa=[0,0,0,0,0];

var mH1=134, mH2=153, mL1=160, mL2=147;

var zL=0, pL=4, curW=18;

var dbRef;



var ctrlLOS=new Array();

var bT=0;

var banR=0;

var dR=0;

var banIndex=0;

var banRnd=0;

var banOne=0;



var dirStr="assets/images/ban/";

var ctrlStr="assets/images/ctrl/";

var ftrDirStr="assets/images/race/";

var ctrlData=["lG.gif","pG.gif","rG.gif","lR.gif","pR.gif","rR.gif"];

var cntlMax=ctrlData.length;

var modeInc=cntlMax/2;



var paurl=document.location.href;

//document.write(paurl);

var isTrail=(paurl.indexOf('trail'));

isTrail=0;



var zombie=0;

var bData=[

	["zombie_500x125.gif","http://www.zombierunner.com",3],

//	["ffmp_500x125.gif","http://www.fleetfeetmenlopark.com",3],

	["atalanta500x125.gif","http://www.skirtgoddess.com",3],

	["ryan500x125.gif","mailto:ryanssportshop@aol.com",3],

	["sportsb500x125.gif","http://www.sportsBasement.com",3],

	["runrev500x125.gif","http://www.runningrevolution.com",3],

	["spbaby500x125.gif","http://www.sportingbaby.com",3] ];





var rData=[

	[2009, 2, 28, 'juanarun200x100.gif','http://www.barron.pausd.org/juanarun/', 'Juana Run 2009', '<b>saturday</b>, feb 28th, palo alto<br>8k, 1mi, kids runs'],

	[2009, 3, 22, 'lfa.gif','http://www.50plus.org/race.php', 'Fitness Alliance Runs', '<b>sunday</b>, mar 22nd, stanford<br> fifty+ 8k, all ages 8k'],

	[2009, 4, 11, 'bulls200x100.gif','bulls.htm', 'Running of the Bulls', '<b>saturday</b>, apr 11th, palo alto<br> 5k, kid&rsquo;s run'],

	[2009, 5, 17, 'ILP_200x100.gif','http://www.raceforliteracy.org/', 'ILP Race for Literacy', '<b>sunday</b>, may 17th, mountain view<br> 5k, 10k'],

	[2009, 6, 28, 'vibha_200x100.gif','http://wiki.vibha.org/Dream_Mile:2009_Bayarea_Home', 'Vibha Dream Mile', '<b>sunday</b>, june 28th, mountain view<br> 5k, 10k & carnival'],

	[2009, 7, 18, 'rob_200x100.gif','http://www.runonbanktnt.org/', 'Run on the Bank', "<b>saturday</b>, july 18th, shoreline park<br>a 1920's themed 10K run,<br>5K walk & social"], 

	[2009, 11, 15, 'homerun2009_200x100.gif','http://www.stanfordhabitat.org/#', 'Stanford Home Run', "<b>sunday</b>, november 15th, stanford<br>5K, 10K, teams"], 

	[2010, 1, 1, 'world_200x100.gif','http://www.worldrunners.org/dp/?q=node/44', "2010 New Year's Run<br>&nbsp;&nbsp;for a Healthy World", "<b>friday</b>, jan 1st, palo alto baylands<br>5K, 10K"],

	[2010, 2, 20, 'juanarun200x100.gif','http://www.barron.pausd.org/juanarun/', 'Juana Run 2010', '<b>saturday</b>, feb 20th, palo alto<br>8k, 1mi, kids runs'],

	[2010, 5, 9, 'bulls200x100.gif','http://www.bulls5k.com/', 'Running of the Bulls', '<b>sunday</b>, may 9th, palo alto<br> 5k, kid&rsquo;s run'],

	[2010, 5, 16, 'ILP_200x100.gif','http://www.raceforliteracy.org/', 'ILP Race for Literacy', '<b>sunday</b>, may 16th, mountain view<br> 5k, 10k'],

	[2010, 6, 27, 'vibha_200x100.gif','http://wiki.vibha.org/Dream_Mile:2010_Bayarea_Home', 'Vibha Dream Mile', '<b>sunday</b>, june 27th, mountain view<br> 5k, 10k & carnival','#ffcc00']

];



var fData=[['Baylands Summer Run',

						'<b>sunday</b>, august 21st<br>palo alto baylands&mdash;5k, 10k', 

						'bsr.gif',

						'http://www.summerrun2010.com/',

						'#007bbe', '#ffffff'],


					 ['Saturday Morning Run',

						'join us at 8:00pm for marathon training at saywer camp',

						'sawyer.gif',

						'saturday.htm',

						'#cff1f8', '#993333'],
					 					 
						['Monday Night Run',

						'join us at 6:10pm for the run<br>route: stanford dish', 

						'monday.gif',

						'monday.htm',

						'#000000', '#e0c090']


];



var ffData=[['Tuesday Night Intervals',

						'join us at 6:30pm for interval training at the stanford track',

						'intervals.gif',

						'tuesday.htm',

						'#cff1f8', '#b1614e'],

					 ['Wednesday Night Run',

						"this week's route: stanford<br>meet at Lucie Stern",

						'wed.gif',

						'wednesday.htm',

						'#cff1f8', '#993333'],

					 ['Saturday Morning Run',

						'join us at 8:00pm for marathon training at saywer camp',

						'sawyer.gif',

						'saturday.htm',

						'#cff1f8', '#993333'],

					 ['Sandwich Party',

						'<b>wednesday</b>, July 21st<br>after the run: <b>members only</b>', 

						'sandwich.gif',

						'wednesday.htm',

						'#990000', '#FFFFFF'],

						['Thurs Night Hill Repeats',

						'join us at 6:10pm for hill repeats<br>meet at fleet feet menlo park',

						'hillrepeat.gif',

						'thursday.htm',

						'#cff1f8', '#993333'],

					 ['Vibha Dream Mile',

						'<b>sunday</b>, june 27th, mountain view<br>5k, 10k & carnival', 

						'vibha_200x100.gif',

						'http://wiki.vibha.org/Dream_Mile:2010_Bayarea_Home',

						'#553870', '#ffcc00'],

					 ['July Trail Run & Party',

						'<b>sunday</b>, the 11th, Stevens Creek County Park/Fremont Older OSP,<br>pool party after the run', 

						'trail.gif',

						'trail2010jul.htm',

						'#a6d6a6', '#555E5E'],

					 ['Pizza Party',

						'<b>wednesday</b>, June 23rd<br>after the run: <b>members only</b>', 

						'pizza.gif',

						'wednesday.htm',

						'#990000', '#FFFFFF'],

					 ['Holiday Intervals',

						'<b>tuesday</b>, Dec 21st, 6:30pm<br>meet at Lucie Stern<br>includes <b>Xmas Tree Lane</b>', 

						'hiAnim.gif',

						'hintervals.htm',

						'#eeeeee', '#3a513a'],

					 ['Monday Night Run',

						'join us at 6:10pm for the run<br>route: stanford dish', 

						'monday.gif',

						'monday.htm',

						'#000000', '#e0c090']

];



var	ftrMax=fData.length;

var	ftrUp=Math.floor(Math.random()*ftrMax);

var	banMax=bData.length;

var	raceMax=rData.length;

var	raceUp=0;



CompileBannerData();

PreloadFirstBanner();

PreloadControls();



//"uchiro.gif","http://www.universitychiroca.com/index.php",1,

//"horsnell.gif","http://www.hazeljhorsnell.com",1,

//"padental.gif","http://www.paloaltodentistry.com",1,

//"szf.gif","http://www.sportzfuel.com",2,

//"menlovelo.gif","mailto:menlovelo@aol.com",1,



//window.document.form1.n1.value=banR;



//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var pCal_beg=[2008, 6, 1];

var pCal_end=[2010, 9, 30];

var pCalDate=new Date();

var pCal_msb, pCal_de, pCal_we;

var msPerMin=1000*60;

var minPerDay=60*24;

var msPerDay=msPerMin*minPerDay;



function SetPCalVars(){

	pCalDate.setFullYear(pCal_beg[0],pCal_beg[1]-1,pCal_beg[2]);

	pCal_msb=pCalDate.getTime()-(pCalDate.getDay() * msPerDay);

document.write('<br>pCal_msb='+pCal_msb);

	pCalDate.setFullYear(pCal_end[0],pCal_end[1]-1,pCal_end[2]);

	pCal_de=Math.floor((pCalDate.getTime()-pCal_msb) / msPerDay);

document.write('<br>pCal_de='+pCal_de);

	pCal_we=Math.floor(pCal_de / 7);

document.write('<br>pCal_we='+pCal_we);

}



function GetPCalMS(){

	return (pCalDate.getTime-pCal_msb);

}

function GetPCalDay(){

	return (Math.floor(GetPCalMS() / msPerDay));

}

function GetPCalWeek(){

	return (Math.floor(GetPCalMS() / (msPerDay*7)));

}

function MakePCalTimeStr(){

	var hour, min, mstr, tstr;

	min = pCalDate.getTime() / msPerMin;

	document.write('<br>tmin='+min);

	min = Math.floor(min % minPerDay);

	document.write('<br>min='+min);

	hour = Math.floor(min / 60);

	min = Math.floor(min % 60);

	document.write('<br>hour='+hour);

	document.write('<br>min='+min);

	

	mstr = (min<10)?'0'+min.toString():min.toString();

	tstr = (hour>12)?(hour-12).toString()+':'+mstr+'pm':hour.toString()+mstr+'am';

return tstr;

}

function SetPCalDate(){

	var args=arguments.length;

	pCalDate=new Date();

	if (args>0) pCalDate.setFullYear(arguments[0]);

	if (args>1) pCalDate.setMonth(arguments[1]-1);

	if (args>2) pCalDate.setDate(arguments[2]);

	if (args>3) pCalDate.setHours(arguments[3]);

	if (args>4) pCalDate.setMinutes(arguments[4]);

}

function SetPCalDay(){

	var args=arguments.length;

	if (args>0) pCalDate.setDate(arguments[0]);

	if (args>1) pCalDate.setHours(arguments[1]);

	if (args>2) pCalDate.setMinutes(arguments[2]);

}

function SetPCalTime(){

	var args=arguments.length;

	if (args>0) pCalDate.setHours(arguments[0]);

	if (args>1) pCalDate.setMinutes(arguments[1]);

}

function SetPCalTimeStr(timeStr){

        var t1, t2, t3;

	var hours=0;

	var mins=0;

document.write('<br>timeStr='+timeStr);

	t1=timeStr.indexOf(':');

        t2=Math.max(timeStr.indexOf('a'),timeStr.indexOf('A'));

        t3=Math.max(timeStr.indexOf('p'),timeStr.indexOf('P'));

document.write('<br>t1='+t1);

document.write('<br>t2='+t2);

document.write('<br>t3='+t3);

	if ( (t1>=0) && ((t2>=0)||(t3>=0)) ) {

	  if (t3>=0) {hours=12; t2=t3;}

          hours+=(timeStr.substring(0, t1))*1;

	  mins=(timeStr.substring(t1+1, t2))*1;

          document.write('<br>'+hours);

          document.write('<br>'+mins);

	}

	SetPCalTime(hours, mins);

}



function TestPCal(){

	SetPCalVars();

	SetPCalDay(2);

	SetPCalTimeStr('5:13pm');

	document.write('<br>make time string='+MakePCalTimeStr());

}

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





function GetFrameLeft(){

	var fW=0; 

	if (self.innerWidth) fW = self.innerWidth-curW;

	else if (document.documentElement && document.documentElement.clientWidth) fW = document.documentElement.clientWidth;

	else if (document.body) fW = document.body.clientWidth;

	var tL=(fW-766)/2; if (tL<pL) tL=pL;

	return tL;

}



function GetTimeTicks(){

	var theDate=new Date();

	return theDate.getTime();

}



function CompileBannerData(){

	var banRank=new Array();



	if (isTrail) {

		banOrder[0]=zombie;

		bData[zombie][2]=0;	

	}

	var cbds=(isTrail)?1:0;



	for (i=0;i<banMax;i++){ 

		banLink[i]=bData[i][1];

		banR+=bData[i][2];

		banRank[i]=banR; 

	}



	for (i=cbds;i<banMax;i++){ 

	  banRnd=Math.floor(Math.random()* banR);

		bT=0;

		while (banRank[bT]<=banRnd) bT++;

		banOrder[i]=bT;

		dR=banRank[bT];

		if (bT>0) dR-=banRank[bT-1];

		banR-=dR;

		for (j=bT;j<banMax;j++) {banRank[j]-=dR}

	}

}



function PreloadControls(){

	for (i=0;i<cntlMax;i++){ 

		ctrlImage[i]=new Image();

		ctrlImage[i].src=ctrlStr+ctrlData[i];

	}

}



function PreloadSubBanners(){

	var i;

	for (i=0;i<banMax;i++) if (i!=banOne) {

		banImage[i]=new Image();

		banImage[i].src=dirStr+bData[i][0];

	}

}



function PreloadFeatureImages(){

	var i;

	for (i=0;i<ftrMax;i++) {

		ftrImage[i]=new Image();

		ftrImage[i].src=ftrDirStr+fData[i][2];

	}

}



function PreloadFirstBanner(){

	document.write('<DIV style="display:none"><IMG SRC='+(dirStr+bData[banOne][0])+'></DIV>');

	banImage[banOne]=new Image();

	banImage[banOne].src=dirStr+bData[banOne][0];

}



function ctrlClick(index) { 

	  for (i=0; i<modeInc; i++) ctrlLOS[i].fontWeight="normal";

		ctrlLOS[index].fontWeight="bold";

		if (index==0){

			speed=1; direction=-1; AdvanceDisplay();

		} else if (index==1){

			speed=0;

		} else if (index==2){

			speed=1; direction=1; AdvanceDisplay();

		} 

}



function mouseOver(index){ 

  document.images['ctrlImg'+index].src=ctrlImage[index+modeInc].src;

  ctrlLOS[index].color="#FFFFFF";

}



function mouseOut(index){ 

  document.images['ctrlImg'+index].src=ctrlImage[index].src;

  ctrlLOS[index].color="#171611";

}





function AdvanceFeature(){

	ftrUp=ftrUp-direction;

	if (ftrUp>=ftrMax) ftrUp=0;

	if (ftrUp<0) ftrUp=ftrMax-1;

}



function DisplayFeature2(num){

	var i;

	for (i=0; i<2*ftrMax-1; i++) {

		document.getElementById("ftrD0"+i).style.display=(i==num)?"display":"none";

		document.getElementById("ftrD1"+i).style.display=((i>num)&&(i<(num+ftrMax)))?"display":"none";

	}

}

function DisplayFeature(num){

	if (num<0) num=0;

	if (num>(ftrMax-1)) num=ftrMax-1;

	var i;

	for (i=0; i<2*ftrMax-1; i++) {

		document.getElementById("ftrD0"+i).style.display=(i==num)?"block":"none";

		document.getElementById("ftrD1"+i).style.display=((i>num)&&(i<(num+ftrMax)))?"block":"none";

	}

}



function AdvanceBanner(){

	banIndex=banIndex+direction;

	if (banIndex==banMax) banIndex=0;

	if (banIndex<0) banIndex=banMax-1;

}



function DisplayBanner(){

	document.images['bI'].src=banImage[banOrder[banIndex]].src;

	FL=document.getElementById('bL'); FL.href=banLink[banOrder[banIndex]];

}



function AdvanceDisplay(){

	AdvanceFeature(); 

	AdvanceBanner();

	DisplayActive();

}

				

function DisplayActive(){

	DisplayBanner();

	if (ftrMax && doRightCol) DisplayFeature(ftrUp);

	

	displaytime=GetTimeTicks();

}

				

function MainLoop(){

	var tL=GetFrameLeft();

	if (!(tL==zL)) {

		zL=tL; 

		dbRef.left=zL;

	}

	for (i=0; i<5; i++) if (mMa[i]) if (!(mMo[i] || mSo[i])) {

		mMa[i]--; if (!mMa[i]) HideSubMenu(i);

	}

	var theTime=GetTimeTicks();	

	if (!ctrlsUp) if (theTime>ctrlsUpTime) {

		document.getElementById('bctrl').style.display="block";	

		ctrlsUp=true;

	}

	var dur=theTime-displaytime;

	if (speed) {

		if (dur>freq) AdvanceDisplay();

	} else displaytime+=dur;



	theTimeout=setTimeout('MainLoop()',loopticks);

}				



function DisplaySubMenu(iObj){

//	document.body.style.backgroundColor = "#cccc88";

	for (i=0; i<5; i++) if (mMa[i]) if (!(iObj==i)) {

		mMa[i]=0; HideSubMenu(i);

	}

	obj2=document.getElementById('Dsm'+iObj).style;

	obj2.left=mData[iObj][0]+mL2;

	obj2.top=mH2;

	obj2.display="block";

	obj3=document.getElementById('Dmsh'+iObj).style;

	obj3.left=mData[iObj][0]+mL1+1;

	obj3.top=mH1+1;

	obj3.display="block";

}



function OverLogo(lobj){

//	document.body.style.backgroundColor = "#ff3366";

		lobj.src='assets/images/PARC2010LOGO2.gif';

}

	

function OutLogo(lobj){

		lobj.src='assets/images/PARC2010LOGO.gif';

}

	

function HideSubMenu(iObj){

//	document.body.style.backgroundColor = "#171611";

	obj2=document.getElementById('Dsm'+iObj).style;

	obj2.display="none";

	obj3=document.getElementById('Dmsh'+iObj).style;

	obj3.display="none";

}

	

function DebugMsg(msg){

	if (debugOut) {

		textOut=msg+'\n'+textOut;

		if (eTA) eTA.value=textOut;

	}

}



function OverMenu(iObj){

	mMa[iObj]=2;

	mMo[iObj]=1;

	DisplaySubMenu(iObj);

}

			

function OverSubMenu(iObj){

	mSo[iObj]=1;

}

				

function OutMenu(iObj){

	mMo[iObj]=0;

}

				

function OutSubMenu(iObj){

	mSo[iObj]=0;

}



function OutSubItem(obj){

	obj.style.color="#171611";

}

				

function OverSubItem(obj){

	obj.style.color="#FFFFFF";

}

				

function DoLink(iObj, jObj){

	DebugMsg("i="+iObj+"  j="+jObj);

	HideSubMenu(iObj);

	window.location.href=mData[iObj][jObj][2];

}



function DoStartPage(){

  if (debugOut) {

		document.write('<DIV ID="Dta"><TEXTAREA STYLE="width:766px;background-color:#bbbb99" ROWS=8 ID="TA" NAME="TAN"> </TEXTAREA></DIV>');

		eTA=document.getElementById('TA');

	}	

	document.write('</DIV>');



	PreloadSubBanners();

	PreloadFeatureImages();



	var Mdiv;

	for (i=0; i<=htj; i++) {

  	Mdiv=document.getElementById('Dmm'+i).style;

		Mdiv.left=mData[i][0]+mL1;

		Mdiv.top=mH1;

		Mdiv.display="block";

	}



  Mdiv=document.getElementById('Dhtj1').style;

	Mdiv.left=mData[htj][0]+mL1+161;

	Mdiv.top=mH1-6;

	Mdiv.display="block";

//  Mdiv=document.getElementById('Dhtj2').style;

//	Mdiv.left=mData[htj][0]+mL1-20;

//	Mdiv.top=mH1+24;

//	Mdiv.display="block";



	for (i=0;i<modeInc;i++) ctrlLOS[i]=document.getElementById('ctrlLab'+i).style;

  

	AdvanceDisplay();

	

  displaytime=GetTimeTicks();

  ctrlsUpTime=displaytime+ctrlsUpLag;

	theTimeout=setTimeout('MainLoop()',loopticks);

}   



function RightBannerControls(){

	var i,ii;



	document.write('<TABLE ID=bctrl style="display:block" CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=49 align=center>');

  	//row for control labels

		document.write('<TR ALIGN="center">');

			document.write('<TD ALIGN="center">');



			for (i=0; i<modeInc; i++) {

				if (i) {

					document.write('  <DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=1 WIDTH=49></DIV>');

					document.write('  <DIV><IMG SRC="sp.gif" HEIGHT=1 WIDTH=1></DIV>');

				}

				document.write('<DIV STYLE="background-color:#a8a588;cursor:pointer" ALIGN="CENTER" onMouseDown="ctrlClick('+i+')" onMouseover="mouseOver('+i+')" onMouseout="mouseOut('+i+')">');

					

					document.write('<DIV ALIGN="CENTER" id="ctrlLab'+i+'" STYLE="font-size:9.0pt;font-weight:normal;color:#171611">'+ctrlLabel[i]+'</DIV>');

					document.write('<DIV ALIGN="CENTER"><IMG id="ctrlImg'+i+'" BORDER=0 SRC='+ctrlImage[i].src+' HEIGHT=21 WIDTH=29></DIV>');

					if (i<modeInc-1) document.write('  <DIV><IMG SRC="sp.gif" HEIGHT=4 WIDTH=1></DIV>');

				document.write('</div>'); 

			}

 			document.write('</TR>'); 

		document.write('</TABLE>');

	document.getElementById('ctrlLab2').style.fontWeight="bold";

}



function WriteMenus(){

	var i,ii,j;

	for (i=0; i<htj; i++) {

		document.write('<DIV ID=Dmm'+i+' class=MENUROOT style="cursor:default;position:absolute;display:none" onMouseOver="OverMenu('+i+')" onMouseOut="OutMenu('+i+')">'+mData[i][1]+'</DIV><DIV ID=Dmsh'+i+' class=MENUSHAD style="cursor:default;position:absolute;display:none">'+mData[i][1]+'</DIV><DIV ID=Dsm'+i+' STYLE="cursor:pointer;position:absolute;display:none;z-index:200" onMouseOver="OverSubMenu('+i+')" onMouseOut="OutSubMenu('+i+')"><DIV><IMG SRC="sp.gif" HEIGHT=5 WIDTH=5></DIV><DIV STYLE="background-color:#171611;padding-left:3px;padding-bottom:3px;padding-right:3px;"><DIV STYLE="background-color:#a8a588;padding-bottom:4px">');



		for (j=2; j<mData[i].length; j++)

			if (mData[i][j][0]) document.write('<DIV class=SUBM'+mData[i][j][0]+' onMouseOver="OverSubItem(this)" onMouseOut="OutSubItem(this)" onClick="DoLink('+i+','+j+');">'+mData[i][j][1]+'</DIV>');

			else document.write('<DIV class=SUBSEP><DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=1 WIDTH=49></DIV></DIV>');

		document.write('</DIV></DIV></DIV>'); 

	}	



	i=htj; 

	ii=(doRightCol)?htj:htj+1; 

	document.write('<DIV ID=Dhtj1 style="background-color:#171611;z-index:500;position:absolute;display:none"><IMG SRC="sp.gif" HEIGHT=32 WIDTH=3></DIV>');

	document.write('<DIV ID=Dmm'+i+' class=MM style="cursor:pointer;position:absolute;display:none;"><A CLASS=MLINK HREF="'+mData[ii][2]+'">'+mData[ii][1]+'</A></DIV>');

}



function DoPreHTML(){

	var i,ii;

	

	zL=GetFrameLeft();

	document.write('<DIV ID="Dref" ALIGN=left STYLE="padding-bottom:4px;position:absolute;top:2px;left:'+zL+'">'); 

	dbRef=document.getElementById('Dref').style;



	document.write('<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=767>');

	

	document.write('<TR VALIGN="TOP">');

	document.write('  <TD WIDTH=1><IMG SRC="sp.gif" HEIGHT=1 WIDTH=1></TD>');

	document.write('  <TD WIDTH=212><IMG SRC="sp.gif" HEIGHT=1 WIDTH=212></TD>');

	document.write('  <TD WIDTH=3><IMG SRC="sp.gif" HEIGHT=1 WIDTH=3></TD>');

	document.write('  <TD WIDTH=349><IMG SRC="sp.gif" HEIGHT=1 WIDTH=349></TD>');

	document.write('  <TD WIDTH=3><IMG SRC="sp.gif" HEIGHT=1 WIDTH=3></TD>');

	document.write('  <TD WIDTH=148><IMG SRC="sp.gif" HEIGHT=1 WIDTH=148></TD>');

	document.write('  <TD WIDTH=3><IMG SRC="sp.gif" HEIGHT=1 WIDTH=3></TD>');

	document.write('  <TD WIDTH=49><IMG SRC="sp.gif" HEIGHT=1 WIDTH=49></TD>');

	document.write('</TR>');



	document.write('<TR VALIGN="TOP">');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#171611"><DIV><IMG SRC="sp.gif" WIDTH=1 HEIGHT=125></DIV>');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 ALIGN="center" VALIGN="top" BGCOLOR="#a8a588">');

if (isWelcome)	document.write('    <DIV><IMG SRC="assets/images/PARC2010LOGO.gif" WIDTH=200 HEIGHT=125 onMouseOver="OverLogo(this)" onMouseOut="OutLogo(this)"></DIV>');

else 	document.write('    <DIV><A HREF="welcome.htm"><IMG SRC="assets/images/PARC2010LOGO.gif" WIDTH=200 HEIGHT=125 onMouseOver="OverLogo(this)" onMouseOut="OutLogo(this)"></A></DIV>');

	document.write('  </TD>');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#171611"><DIV><IMG SRC="sp.gif" WIDTH=3 HEIGHT=1></DIV></TD>');

	document.write('  <TD bgcolor="#a8a588" ROWSPAN=1 COLSPAN=3><DIV><a id=bL><img id=bI border=0 width=500 height=125></a><DIV></TD>');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#171611"><DIV><IMG SRC="sp.gif" WIDTH=3 HEIGHT=1></DIV></TD>');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#a8a588" ALIGN="CENTER">');

	document.write('    <DIV><IMG SRC="sp.gif" HEIGHT=1 WIDTH=1></DIV>');

	RightBannerControls();

	document.write('  </TD>');

	document.write('</TR>');



	document.write('<TR VALIGN="TOP">');

	document.write('  <TD ROWSPAN=1 COLSPAN=8 BGCOLOR="#171611"><DIV><IMG SRC="sp.gif" WIDTH=1 HEIGHT=3></DIV></TD>');

	document.write('</TR>');



	document.write('<TR VALIGN="TOP">');

	document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#171611">');

	document.write('    <DIV><IMG SRC="sp.gif" HEIGHT=25 WIDTH=1></DIV>');

	document.write('  </TD>');

	document.write('  <TD ROWSPAN=1 COLSPAN=3 BGCOLOR="#a8a588">');

  WriteMenus();

	document.write('    <DIV><IMG SRC="sp.gif" WIDTH=1 HEIGHT=29></DIV>');

	document.write('    <DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" WIDTH=562 HEIGHT=3></DIV>'); 

	document.write('    <DIV STYLE="background-color:#D5D5c2;padding:9px;padding-bottom:0px">');

}



function DoPostHTML() {

	if (doRightCol) { 

		document.write('    <DIV><IMG STYLE="background-color:#D5D5c2" SRC="sp.gif" WIDTH=3 HEIGHT=9></DIV>');

		document.write('    </DIV>');

		document.write('   </DIV>');

		document.write('  </TD>');

		document.write('  <TD ROWSPAN=1 COLSPAN=1 BGCOLOR="#171611">');

		document.write('    <DIV><IMG SRC="sp.gif" WIDTH=3 HEIGHT=1></DIV>');

		document.write('  </TD>');

		document.write('  <TD ROWSPAN=2 COLSPAN=3 ALIGN="LEFT" BGCOLOR="#171611" WIDTH=200>');

		DoRightColumnHTML()

	}

	document.write('   </TD>');

	document.write('  </TR>');

	document.write(' </TABLE>');

	document.write('</DIV>');

}



function DoRightColumnHTML() {

		AddFeatureList();

		AddAffiliations();

		document.write('<DIV><IMG SRC="sp.gif" HEIGHT=9 WIDTH=200></DIV>');

}



function DoPageMenuHTML() {

	var i; var stst='';

	var argno=arguments.length;	

	if (argno) {

		document.write('       <DIV STYLE="background-color:#171611;padding:3px">');

		for (i=0; i<argno; i++) {

			if (argno>1) {

				if (i==0) stst='STYLE="padding-bottom:1px"';

				else if (i==argno-1) stst='STYLE="padding-top:1px"';

				else stst='STYLE="padding-bottom:1px;padding-top:1px"';	

			}

			document.write('          <DIV '+stst+'ALIGN="CENTER" CLASS=SUBB><A CLASS=BLINK HREF="'+arguments[i][1]+'">'+arguments[i][0]+'</A></DIV>');

		}

		document.write('        </DIV>');

	}

}

	



function AddFeatureList(){

	var i;

	for (i=0; i<ftrMax; i++) AddFeature(fData[i][0], fData[i][1], fData[i][2], fData[i][3], fData[i][4], fData[i][5], i);

	for (i=0; i<ftrMax-1; i++) AddFeature(fData[i][0], fData[i][1], fData[i][2], fData[i][3], fData[i][4], fData[i][5], i+ftrMax);

}



function DoPageLink(pStr){

	window.location.href=pStr;

}



function SetRSHcolor(obj, color){

	obj.style.color=color;

}



function AddFeature(fhead, ftext, imgsrc, ftrlnk, color, bgcolor, fi){

	document.write('		<div class="rstS" id="ftrD0'+fi+'" style="display:none;color:'+color+';background-color:'+bgcolor+'" onclick="DoPageLink(&#39;'+ftrlnk+'&#39;);return false;">');

	document.write('			<div><img class="rstI" src="assets/images/race/'+imgsrc+'"></a></div>');

	document.write('			<div class="rstC">');

	document.write('				<div class="rstH">'+fhead+'</div>');

	document.write('				<div class="rstT">'+ftext+'</div>');

	document.write('			</div>');

	document.write('<div STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=3 WIDTH=200></DIV>');

	document.write('		</div>');

	

	document.write('		<div class="rstS" id="ftrD1'+fi+'" style="display:none" onclick="DoPageLink(&#39;'+ftrlnk+'&#39;);return false;" onmouseover="SetRSHcolor(this, &#39;#FFFFFF&#39;)" onmouseout="SetRSHcolor(this, &#39;#171611&#39;)">');

	document.write('			<div class="rstC">');

	document.write('				<div class="rstH">'+fhead+'</div>');

	document.write('				<div class="rstT">'+ftext+'</div>');

	document.write('			</div>');

	document.write('<div STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=3 WIDTH=200></DIV>');

	document.write('		</div>');	

}



function AddItem (fhead, ftext, ftrlnk){

	document.write('		<div class="rstS" onclick="DoPageLink(&#39;'+ftrlnk+'&#39;);return false;" onmouseover="SetRSHcolor(this, &#39;#FFFFFF&#39;)" onmouseout="SetRSHcolor(this, &#39;#171611&#39;)">');

	document.write('			<div class="rstC">');

	document.write('				<div class="rstH">'+fhead+'</div>');

	document.write('				<div class="rstT">'+ftext+'</div>');

	document.write('			</div>');

	document.write('<div STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=3 WIDTH=200></DIV>');

	document.write('		</div>');	

}



function AddAffiliations(){

	document.write('<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=200>');

	document.write('<TR><TD BGCOLOR=#ffffff WIDTH=80>');

	document.write('<DIV style="padding-right:1px"><A HREF="http://www.rrca.org/"><IMG SRC="assets/images/rrca_rc.gif"></A></DIV>');

	document.write('</TD><TD WIDTH=80>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=124 WIDTH=3></DIV>');

	document.write('</TD><TD WIDTH=117>');

	document.write('<DIV><A HREF="http://www.trailrunner.com/"><IMG SRC="assets/images/atra_top.gif"></A></DIV><DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=3 WIDTH=2></DIV><DIV><A HREF="http://www.cityofpaloalto.org/recreation/default.asp"><IMG SRC="assets/images/pa_top.gif"></A></DIV>');

	document.write('</TD></TR></TABLE>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=3 WIDTH=200></DIV>');

}	



function AddNoneOfThese(){

	return;

	document.write('<TR><TD BGCOLOR=#99ccff>');

	document.write('<DIV><A HREF="hintervals.htm"><IMG SRC="assets/images/hia.gif" HEIGHT=200 WIDTH=200></A></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');



	document.write('<TR><TD BGCOLOR=#FFFFFF>');

	document.write('<DIV><a href="raffle.htm"><IMG SRC="assets/images/raffle.gif" HEIGHT=120 WIDTH=200></a></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');



	document.write('<TR><TD BGCOLOR=#FFFFFF>');

	document.write('<DIV><A HREF="http://www.stanford.edu/group/habitat/"><IMG SRC="assets/images/homerun2008.gif" HEIGHT=97 WIDTH=200></A></DIV>');

	document.write('<DIV CLASS="RSH" STYLE="padding-top:0px">Stanford Home Run</DIV>');

	document.write('<DIV CLASS="RS1"><SPAN CLASS="BOLD">sunday</SPAN>, nov 16th, 2008<br>5K run/walk, 10K run&mdash;<A HREF="http://www.stanford.edu/group/habitat/">more info</A></DIV>');

	document.write('<DIV><IMG SRC="sp.gif" HEIGHT=6 WIDTH=1></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#99ccff>');

	document.write('<DIV><A HREF="http://www.sportingbaby.com"><IMG SRC="assets/images/sblogo.gif" HEIGHT=150 WIDTH=200></A></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#99ccff>');

	document.write('<DIV><A HREF="hintervals.htm"><IMG SRC="assets/images/hi.gif" HEIGHT=200 WIDTH=200></A></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#FFFFFF>');

	document.write('<DIV CLASS="RSH" STYLE="font-size:14pt;color:#990000">2008 Holiday Party</DIV>');

	document.write('<DIV CLASS="RS1" STYLE="color:#006600"><SPAN CLASS="BOLD">monday</SPAN>, dec 8th, at Estrellita Restaurant&mdash;<A HREF="hparty.htm">more info</A></DIV>');

	document.write('<DIV><IMG SRC="sp.gif" HEIGHT=6 WIDTH=1></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#99ccff>');

	document.write('<DIV CLASS="RSH">Wednesday Night Run<br>HOLIDAY BREAK</DIV>');

	document.write('<DIV CLASS="RS1">Wednesday Night Runs scheduled for Dec 24 and Dec 31 have been cancelled.</DIV>');

	document.write('<DIV><IMG SRC="sp.gif" HEIGHT=6 WIDTH=1></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#99ccff>');

	document.write('<DIV CLASS="RSH">Wed. Night Run Routes</DIV>');

	document.write('<DIV CLASS="RS1">a schedule of the upcoming routes for the wed night run has been posted at <A HREF="wednesday.htm#listing">route listing</A>.</DIV>');

	document.write('<DIV><IMG SRC="sp.gif" HEIGHT=6 WIDTH=1></DIV>');

	document.write('<DIV STYLE="background-color:#171611"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

	

	document.write('<TR><TD BGCOLOR=#884422>');

	document.write('<DIV><A HREF="calendar.htm"><IMG SRC="assets/images/bbq1.gif" HEIGHT=200 WIDTH=200></A></DIV>');

	document.write('<DIV STYLE="background-color:#884422"><IMG SRC="sp.gif" HEIGHT=4 WIDTH=200></DIV>');

	document.write('</TD></TR>');

}