var menuArray = new Array();
var N4, N5, IE4, IE5;

function setGlobals(){
	N4 = document.layers?true:false;
	N5 = (!document.all && document.getElementById)?true:false;
	IE4 = (document.all && !document.getElementById)?true:false;
	IE5 = (document.all && document.getElementById)?true:false;
	if (N4) {var origWidth = window.innerWidth;var origHeight = window.innerHeight;window.onresize = reDo;}
}
function reDo() {if (window.innerWidth != origWidth || window.innerHeight != origHeight) location.reload();}

function menuObj(lay,nr){
	if(N4){
		this.lay = document.layers[lay];
		this.lay.parentNr = nr;
		this.lay.write = writeLay;
		this.lay.hide = hideLay;
		this.lay.show = showLay;
	}else{
		if(IE4)
			this.lay = document.all[lay];
		else
			this.lay = document.getElementById(lay);
		this.lay.parentNr = nr;
		this.lay.write = writeLayIE;
		this.lay.hide = hideLayIE;
		this.lay.show = showLayIE;
	}
	this.lay.onmouseover = menuLayOver;
	this.lay.onmouseout = menuLayOut;
}
function menuLayOver(){if(!N4) selVis("hidden");clipMenu(this.parentNr);hideAll();this.show();}
function menuLayOut(){this.hide();hideMarker();if(!N4) selVis("visible");}

function writeLay(txt){this.document.write(txt);this.document.close();}
function writeLayIE(txt){this.innerHTML = txt + '<div></div>';}
function hideLay(){this.visibility = "hide";}
function showLay(){this.visibility = "show";}
function hideLayIE(){this.style.visibility = "hidden";}
function showLayIE(){this.style.visibility = "visible";}

function selVis(vis){
	/***** no forms under the dropdowns right now...
	for(var i=0;i<document.forms.length;i++)
		for(var n=0;n<document.forms[i].elements.length;n++)
			if(document.forms[i].elements[n].type.substring(0,6) == "select")
				document.forms[i].elements[n].style.visibility=vis;
	*/
}
function hideAll() {
	for(var i=0;i < menuArray.length;i++)
		menuArray[i].lay.hide();
}
function hideMenus(){hideAll();hideMarker();if(!N4) selVis("visible");}

function showMenu(nr){
	if(menuArray.length>0){ // menus created
		if(!N4) selVis("hidden");
		clipMenu(nr);
		hideAll();
		menuArray[nr].lay.show();
	}
}

function drawMenu(){
	setGlobals();
	var menuTxt = [	
[["administration","about_administration.html"],["contact us","contactus.html"],["HIPAA","about_hipaa.html"],["history &amp; milestones","about_history.html"],["map &amp; directions","about_directions.html"],["mission statement","about_mission.html"],["parent/guardian survey", "surveyresults.html"],["resident rights","about_rights.html"],["tours","about_tours.html"],["visiting hours","about_hours.html"],["what we do","about_what.html"]],

//,["our business","about_business.html"]

[["board&nbsp;of&nbsp;trustees","board_trustees.html"],["health&nbsp;advisory&nbsp;board","board_advisory.html"],["development&nbsp;board","board_development.html"],["development&nbsp;board&nbsp;extranet","./board/"]],

[["donate&nbsp;online","donate_online.html"],["donate&nbsp;by&nbsp;phone&nbsp;or&nbsp;mail","donate_phone_mail.html"],["endowment","about_endowment.html"],["planned&nbsp;giving","planned_giving.html"],["who&nbsp;to&nbsp;contact","donate_contact.html"]],

[["Employment&nbsp;Opportunities","http://heinzerling.careerboard.com"]],


[["24th&nbsp;Golf&nbsp;Classic&nbsp;-&nbsp;09/20/10","events_2010_golf.html"]],


[["opportunities","volunteers.html"]]




//,[["make&nbsp;a&nbsp;gift","gift.html"],["volunteer","volunteers.html"]]

];

//[["financial&nbsp;reports","financial_reports.html"],["form&nbsp;990","financial_990.html"]]

//[["golf&nbsp;marathon","Golf_Marathon_Information.pdf"],["casino gala","casino_gala.html"],["golf&nbsp;classic","golf_classic.html"]],

//[["benefits","benefits.html"],["opportunities","opportunities.html"]]

	for(var i=0;i<menuTxt.length;i++){
		menuArray[i] = new menuObj('topMenu'+i,i);
		var mTxt = "";
		for(var n=0;n<menuTxt[i].length;n++){
			if(document.getElementById)
				mTxt += '<tr><td height="15" style="border-top: 1px solid #003C87;border-left: 1px solid #003C87;border-right: 1px solid #003C87;" bgcolor="#EBE7DE" onmouseover="lOver(this)" onmouseout="lOut(this)" ';
			else
				mTxt += '<tr><td height="15" style="border-top: 1px solid #003C87;border-left: 1px solid #003C87;border-right: 1px solid #003C87;" bgcolor="#EBE7DE" ';
			if(!N4) 
				mTxt += 'style="cursor:hand"';
			mTxt += 'onclick="goLink(\''+ menuTxt[i][n][1] +'\');return false"><span class="navtext"><A href="'+menuTxt[i][n][1]+'">&nbsp;&nbsp;'+menuTxt[i][n][0]+'</A>&nbsp;&nbsp;</span></td></tr>';
		}
		menuArray[i].lay.write('<table bgcolor="EBE7DE" cellspacing=0 border=0 width="150">'+mTxt+'<tr bgcolor="white"><td style="border-top: 1px solid #003C87;" height="2"><img src="images/spacer.gif" width="1" heght="1"></td></tr></table>');
	}
}
function lOver(obj){
	if(!N4){ 
		obj.style.backgroundColor = "003C87";
		if(obj.children)
			obj.children[0].children[0].style.color = "FFFFFF";
	}
}
function lOut(obj){
	if(!N4){
		//obj.style.backgroundColor = "DAD6CD";
		obj.style.backgroundColor = "EBE7DE";
		if(obj.children)
			obj.children[0].children[0].style.color = "7591B2";
			//obj.children[0].children[0].style.color = "6699CC";
	}
}

//var menuclipArea = [[0,114],[115,216],[220,250],[251,251],[400,400]];
var menuclipArea = [[0,0],[115,216],[220,250],[251,251]];

function clipMenu(indx){
	if(indx < menuclipArea.length){
		if(N4)
			var mLay = document.layers['markLay'];
		else if(IE4)
			var mLay = document.all['markLay'];
		else
			var mLay = document.getElementById('markLay');
		mLay.setClip = N4?setClip:setClipIE;
		mLay.show = N4?showLay:showLayIE;
		mLay.setClip(menuclipArea[indx][0], 0, menuclipArea[indx][1], 20);
		mLay.show();
	}
}
function hideMarker(){
	if(N4)
		var mLay = document.layers['markLay'];
	else if(IE4)
		var mLay = document.all['markLay'];
	else
		var mLay = document.getElementById('markLay');
	mLay.hide = N4?hideLay:hideLayIE;
	mLay.hide();
}
function setClip(x, y, x2, y2){
	this.clip.left = x;
	this.clip.top = y;
	this.clip.right = x2;
	this.clip.bottom = y2;
}
function setClipIE(x, y, x2, y2){
	this.style.clip = "rect("+y+" "+x2+" "+y2+" "+x+")";
}
function openStoryWin(){
	window.open("","windowName","width=400,height=400,top=20,left=20");
}
function goLink(linkStr){
	window.location = linkStr;
}
function resetForm(lay, formName){
	if(document.layers)
		document.layers[lay].document.forms[formName].reset();
	else if(document.getElementById)
		document.getElementById(formName).reset();
	else
		document.forms[formName].reset();
}
//********** debug *************
/*
function showMouseLocation(){
	var x = event.clientX;
	var y = event.clientY;
	window.status = "DEBUG   x:"+x+"    y:"+y;
}
if(!N4){ 
	document.onmousemove = showMouseLocation; 
}
*/



