var HtmlStr;

var ArrMenu1 = ["Who We Are","Staff Directory","Board Leadership"];//,"Community Partners"];
var ArrMenu2 = ["Y Children's Station","Y Youth & Government","Y Camp","Y Parent/Child Program","Y Youth Sports","Anaheim Achieves"];
var ArrMenu3 = ["Calendar of Events"];
var ArrMenu4 = ["Become a Mentor","Volunteer Opportunities","GOAL Getters"];
var ArrMenu5 = ["Job Listings","Benefits","Interest Form"];
var ArrMenu6 = ["Make a Donation","Endowment Fund","Current Supporters"];
var ArrMenu7 = [""];

var ArrLink1 = ["about/who.htm","about/staff.htm","about/board.htm"];//,"about/community.htm"];
var ArrLink2 = ["service/child.htm","service/youth.htm","service/camp.htm","service/parent.htm","service/sports.htm","service/anaheim.htm"];
var ArrLink3 = ["calendar/index.htm"];
var ArrLink4 = ["get/become.htm","get/volunteer.htm","get/GOAL-getters.htm"];
var ArrLink5 = ["employ/job.htm","employ/benefit.htm","employ/application.htm"];
var ArrLink6 = ["contri/make.htm","contri/estate.htm","contri/current.htm"];
var ArrLink7 = [""];

NS4 = document.layers;
if (NS4) {
      origWidth = innerWidth;
      origHeight = innerHeight;
   }

function reDo() {
   if (innerWidth != origWidth || innerHeight != origHeight) 
      location.reload();
}

if (NS4) onresize = reDo;


function showM(name, flag) {
	if (document.layers) {
		var show = "show";
		var hide = "hide";
		var obj = eval("document.layers['" + name + "']");
		obj.top = 58;
	} else {
		var show = "visible";
		var hide = "hidden";
		var obj = eval("document.all['" + name + "'].style");
		obj.top = 57;
	}

	if (flag == "show") {
		if(name == "menu1"){
			obj.left =188;
//			obj.top = 57;
		}else if(name == "menu2"){
			obj.left = 276;
//			obj.top = 57;
		}else if(name == "menu3"){
			obj.left = 346;
//			obj.top = 57;
		}else if(name == "menu4"){
			obj.left = 434;
//			obj.top = 57;
		}else if(name == "menu5"){
			obj.left = 518;
//			obj.top = 57;
		}else if(name == "menu6"){
			obj.left = 608;
//			obj.top = 57;
		}else if(name == "menu7"){
			obj.left = 698;
//			obj.top = 57;
		}
		obj.visibility = show;
	} else {
		obj.visibility = hide;
	}
}

function init() {
	if (document.layers) {
		document.menu1.onMouseOver=new Function("showM('menu1', 'show')");
		document.menu1.onMouseOut=new Function("showM('menu1', 'hide')");
		document.menu2.onMouseOver=new Function("showM('menu2', 'show')");
		document.menu2.onMouseOut=new Function("showM('menu2', 'hide')");
		document.menu3.onMouseOver=new Function("showM('menu3', 'show')");
		document.menu3.onMouseOut=new Function("showM('menu3', 'hide')");
		document.menu4.onMouseOver=new Function("showM('menu4', 'show')");
		document.menu4.onMouseOut=new Function("showM('menu4', 'hide')");
		document.menu5.onMouseOver=new Function("showM('menu5', 'show')");
		document.menu5.onMouseOut=new Function("showM('menu5', 'hide')");
		document.menu6.onMouseOver=new Function("showM('menu6', 'show')");
		document.menu6.onMouseOut=new Function("showM('menu6', 'hide')");
		document.menu7.onMouseOver=new Function("showM('menu7', 'show')");
		document.menu7.onMouseOut=new Function("showM('menu7', 'hide')");
	}
}

function writeMenu(idName,Twidth,arr1,arr2) {
	
	Arry1 = eval( arr1);
	Arry2 = eval( arr2);

	HtmlStr = "";
	HtmlStr += "<!------- " + idName + " ------->";
	HtmlStr += "<div id=\"" + idName + "\" class=\"popup\" onMouseOver=\"showM('" + idName + "', 'show');\" onMouseOut=\"showM('" + idName + "', 'hide');\">";
	HtmlStr += "<table width=\"" + Twidth + "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";
	HtmlStr += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	HtmlStr += "<tr><td><img src=\"image/clear.gif\"  width=\"1\"  height=\"6\" alt=\"\" border=\"0\"></td></tr>";
	HtmlStr += "<tr><td>";

	for ( i=0; i<Arry1.length; i++ ){
		HtmlStr += "<a href=\"" + Arry2[i] + "\" class=\"menu\">" + Arry1[i] + "</a><br>";
	}
	HtmlStr += "</td></tr>";
	HtmlStr += "<tr><td><img src=\"image/clear.gif\"  width=\"1\"  height=\"6\" alt=\"\" border=\"0\"></td></tr>";
	HtmlStr += "</table>";
	HtmlStr += "</td></tr></table>";
	HtmlStr += "</div>";

	document.write (HtmlStr);

}

function writeNav() {

	HtmlStr = "";
	HtmlStr += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"Black\">";
	HtmlStr += "<tr>";
	HtmlStr += "<td rowspan=\"3\" valign=\"top\"><A HREF=\"index.htm\" TARGET=\"_self\"><img src=\"image/logo.gif\" width=\"168\" height=\"57\" alt=\"\" border=\"0\"></a></td>";
	HtmlStr += "<td valign=\"top\"><img src=\"image/top_pic.gif\" width=\"603\" height=\"26\" alt=\"\" border=\"0\"></td>";
	HtmlStr += "	<td rowspan=\"3\" bgcolor=\"black\" width=\"100%\"><img src=\"image/clear.gif\"  width=\"10\"  height=\"57\" alt=\"\" border=\"0\"></td>";
	HtmlStr += "</tr>";
	HtmlStr += "<tr><td valign=\"top\"><img src=\"image/slogan.gif\" width=\"603\" height=\"15\" alt=\"\" border=\"0\"></td></tr>";
	HtmlStr += "<tr><td valign=\"top\"><A HREF=\"about.htm\" TARGET=\"_self\" onMouseOver=\"select('A');showM('menu1', 'show');\" onMouseOut=\"deselect('A');showM('menu1', 'hide');\"><img src=\"image/n_abot0.gif\" width=\"92\" height=\"16\" alt=\"\" border=\"0\" name=\"A\"></a><A HREF=\"service.htm\" TARGET=\"_self\" onMouseOver=\"select('B');showM('menu2', 'show');\" onMouseOut=\"deselect('B');showM('menu2', 'hide');\"><img src=\"image/n_ser0.gif\" width=\"70\" height=\"16\" alt=\"\" border=\"0\" name=\"B\"></a><A HREF=\"what.htm\" TARGET=\"_self\" onMouseOver=\"select('C');showM('menu3', 'show');\" onMouseOut=\"deselect('C');showM('menu3', 'hide');\"><img src=\"image/n_what0.gif\" width=\"86\" height=\"16\" alt=\"\" border=\"0\" name=\"C\"></a><A HREF=\"get.htm\" TARGET=\"_self\" onMouseOver=\"select('D');showM('menu4', 'show');\" onMouseOut=\"deselect('D');showM('menu4', 'hide');\"><img src=\"image/n_get0.gif\" width=\"87\" height=\"16\" alt=\"\" border=\"0\" name=\"D\"></a><A HREF=\"employ.htm\" TARGET=\"_self\" onMouseOver=\"select('E');showM('menu5', 'show');\" onMouseOut=\"deselect('E');showM('menu5', 'hide');\"><img src=\"image/n_emp0.gif\" width=\"87\" height=\"16\" alt=\"\" border=\"0\" name=\"E\"></a><A HREF=\"contri.htm\" TARGET=\"_self\" onMouseOver=\"select('F');showM('menu6', 'show');\" onMouseOut=\"deselect('F');showM('menu6', 'hide');\"><img src=\"image/n_contr0.gif\" width=\"93\" height=\"16\" alt=\"\" border=\"0\" name=\"F\"></a><A HREF=\"cont.htm\" TARGET=\"_self\" onMouseOver=\"select('G');showM('menu7', 'show');\" onMouseOut=\"deselect('G');showM('menu7', 'hide');\"><img src=\"image/n_cont0.gif\" width=\"88\" height=\"16\" alt=\"\" border=\"0\" name=\"G\"></a></td></tr>";
	HtmlStr += "</table>";

	document.write (HtmlStr);

}

function writeItem() {
	writeMenu('menu1',140,ArrMenu1,ArrLink1);
	writeMenu('menu2',150,ArrMenu2,ArrLink2);
	writeMenu('menu3',110,ArrMenu3,ArrLink3);
	writeMenu('menu4',150,ArrMenu4,ArrLink4);
	writeMenu('menu5',80,ArrMenu5,ArrLink5);
	writeMenu('menu6',130,ArrMenu6,ArrLink6);
	writeMenu('menu7',150,ArrMenu7,ArrLink7);
}