// by  j. lamberson
var ie4;
var ns4;
var imgPath="http://www.westsideacademy.com/boysteam/";
// nav menu
blst=new Array(
	["about"],["default","Home and News"],["membership","Membership Info"],["dues","Club Dues"],["participation","Parental Participation"],["usag","USA Gymnastics Membership"],["faq","Frequently Asked Questions"],
	["operations"],["directors","Board of Directors"],["fundraising","Fundraising Subcommittees"],["meetings","Club Meetings and Minutes"],["webadmin","Webmaster's Admin Page"],
	["meetinfo"],["schedule","Meet Calendar and Details"],["gymlinks","Gym Locations and Links"],
	["team"],["roster","Boys Team Roster"],["coaches","Coach Biographies"],
	["equipment"],["buildit","Homemade Equipment Plans"]
);
// email functions
var mt='<a href="mailto:';
function Mail(nam,dom,vis){a=nam+'@'+dom;document.write(mt+a+'">'+((Mail.arguments.length==3)?vis:a)+'</a>')}
function ma(sym){var i=mi[sym];return i[1]+'@'+i[2];}
function mlto(sym,fld){var i=mi[sym];document.write(mt+ma(sym)+'">'+i[fld]+'</a>');}
function mailadr(sym){var a=ma(sym);document.write(mt+a+'">'+a+'</a>');}
function mailnam(sym){mlto(sym,0);}
function mailsym(sym){var i=mi[sym];document.write(mt+ma(sym)+'">'+sym+'</a>');}
// navbar functions
var bw=100;
var bh=19;
function preload(){
 for(i=0;i<blst.length;i++){
	bn=blst[i][0];
	eval(bn+"Off=new Image("+bw+","+bh+")");
	eval(bn+"Off.src='"+imgPath+bn+"Off.gif'");
	eval(bn+"On=new Image("+bw+","+bh+")");
	eval(bn+"On.src='"+imgPath+bn+"On.gif'");
 }
}
preload();
function roll(imgname,mouseover){
	filename=imgname+(mouseover?"On":"Off");
		document.images[imgname].src=eval(filename+".src");
}
function init(){
	ie4=(document.body.clientWidth!=null);
	ns4=(window.pageYOffset!=null);
	window.onscroll=window.onresize=resiz;
	if(ns4){poll();self.setInterval("poll()",50);} //netscape
	resiz();
}
function resiz(){
 with(document.body){
	w=scrollLeft+clientWidth;
	h=scrollTop+clientHeight-171;
 }
 with(document){
	getElementById("ban").style.width=w;
	getElementById("nav").style.height=(h>0?h:0);
}
}
// netscape scroll
var xos;
var yos;
function poll(){
 with(window){
	document.body.scrollTop=pageYOffset; //IE model
	document.body.scrollLeft=pageXOffset;
	document.body.clientWidth=innerWidth-20; //fudge for scrollbars
	document.body.clientHeight=innerHeight-20;
	if(xos!=null){ //not initial event
		if((pageXOffset!=xos)||(pageYOffset!=yos)) //scrolled
			resiz();
	}
	xos=pageXOffset; //save state
	yos=pageYOffset;
 }
}
function OpenBody(){
 if(ns4)preload();
 with(document){
	//banner
	write("<DIV ID='ban' STYLE='position:absolute;top:0px;left:0px;width:100%;height:152px;background-color:#082173;z-index:1;'><IMG HEIGHT=152 WIDTH=640 SRC='"+imgPath+"BoysTeamBanner.jpg\' BORDER=0 ALT=''></DIV>");
	write("<DIV STYLE='position:absolute;top:152px;left:0px;width:100px;height:19px;z-index:1;'><IMG HEIGHT=19 WIDTH=100 SRC='"+imgPath+"subbanner.gif' BORDER=0 ALT=''></DIV>");
	write("<DIV STYLE='position:absolute;top:152px;left:100px;width:12px;height:12px;z-index:1;'><IMG HEIGHT=12 WIDTH=12 SRC='"+imgPath+"bannercorner.gif' BORDER=0 ALT=''></DIV>");
	// navbar
	write("<DIV ID='nav' STYLE=\"position:absolute;top:171px;left:0px;width:100px;height:100%;background-image:url('"+imgPath+"subbanner.gif'); z-index: 1;\">");
	write("<FORM ACTION='http://search.freefind.com/find.html' METHOD='GET' target='_self'>");
	write("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 STYLE='background-color:transparent'>");
	// navlist
	for(i=0;i<blst.length;i++){
		bn=blst[i][0];alt=blst[i][1];
		write("<TR ALIGN='LEFT' VALIGN='TOP'><TD WIDTH=100 HEIGHT=19");
		if(blst[i].length>1) // button
			write("><A HREF='"+imgPath+bn+".php' onMouseOver=\"roll('"+bn+"',1)\" onMouseOut=\"roll('"+bn+"',0)\"><IMG ID='"+bn+"' NAME='"+bn+"' HEIGHT=19 WIDTH=100 SRC='"+imgPath+bn+"Off.gif' BORDER=0 ALT='"+alt+"' TITLE='"+alt+"'></A>");
		else // header
			write(" BGCOLOR='#082173'><IMG ID='"+bn+"' NAME='"+bn+"' HEIGHT=19 WIDTH=100 SRC='"+imgPath+bn+".gif' BORDER=0 ALT=''>");
		write("</TD></TR>");
	}
	// content
	write("</TABLE></FORM></DIV><DIV STYLE='position:absolute;top:171px;left:120px;width:520px;background-color:#FFFFFF;z-index:1;'>");
 }
}
function CloseBody(){document.write("</DIV>");}
