// IDDAmenus copyright 2003 - Philip Tardif and IDDA - all rights reserved
// IDDAmenus default values

var justification = "left";
var margin_padding = 0;
var exit_zone = 140;
// var up_dir = (section == "") ? "" : "../";
var transparent_img = "images/spacer.gif";
doc_url = document.URL;
// alert('doc_url: ' + doc_url); // ############################
var top_pad = 6;
var bottom_pad = 2;
var arrow_align = "right";

var visible_divs = new Array();
var IDDAmenus = new Array();
var indent_continue = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
var indent_continue2 = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
var indent_sub_item = "&nbsp;&nbsp;&nbsp;&nbsp;";

/* set menu values to the array as such:
IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,
txw, bxw, lxh, lxv, rxh, rxv, txh, bxh, lxw, rxw, css_class, bordercolor, bordercolorlight, bordercolordark,
[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],
[...],
[...]];
*/
var bgcoloralt = "#dceae4";
var bgcolor_over = "#dceae4";
var bgcoloralt_b = "#fbfbd0";

p1_left = 59;
p2_left = 140;
p3_left = 226;
p3s_left = 376;
p3s2_top = 150;
p3s3_top = 165;
p4_left = 366;
p5_left = 732;


if(userAgent.indexOf("Safari") > 0) {
	p1_left = 60;
	p2_left = 139;
	p3_left = 221;
	p3s2_top = 153;
	p3s3_top = 171;
	p3s_left = 371;
	p4_left = 345;
	p5_left = 690;
} else if(userAgent.indexOf("Firefox") > 0) {
// alert('userAgent = ' + userAgent); // ##################################
	if(userAgent.indexOf("Windows") > 0) {
		p1_left = 64;
		p2_left = 142;
		p3_left = 228;
		p3s_left = 378;

		p4_left = 360;
		p5_left = 710;
	} else {
		p1_left = 64;
		p2_left = 145;
		p3_left = 230;
		p3s_left = 376;

		p4_left = 368;
		p5_left = 732;
	}
}
 	IDDAmenus[0] = ["p1", p1_left, 135, 120, , "left", 0, "#fbfbd0", "absolute", "hidden",
	, 120, 90, "top", 90, "top", , , , , "dropdowns", , , ,
	["history.shtml", "History & Mission", , 3, "no sub", , , "p1_1"],
	["presidentLetter.shtml", "President's Letter", , 2, "no sub", , , "p1_2"],
	["board.shtml", "Board of Directors", , 2, "no sub", , , "p1_3"],
	["profilesSpirit.shtml", "Profiles in Spirit", , 1, "no sub", , , "p1_4"],
	["staff.shtml", "Staff", , 16, "no sub", , , "p1_5"]
	];

	IDDAmenus[1] = ["p2", p2_left, 135, 134, , "left", 0, "#fbfbd0", "absolute", "hidden",
	, 134, 76, "top", 76, "top", , , , , "dropdowns", , , ,
	["programs.shtml", "Programs", , 1, "no sub", , , "p2_1"],
	["calendar.shtml", "Calendar", , 1, "no sub", , , "p2_2"],
	["victoryCenter.shtml", "Victory Center", , 1, "no sub", , , "p2_3"],
	["communityChallenges.shtml", "Community Challenges", , 1, "no sub", , , "p2_4"],
	["textileCenter.shtml", "Textile Arts Center", , 1, "no sub", , , "p2_5"],
	["cedarchest.shtml", "Cedarchest", , 1, "no sub", , , "p2_6"]
	];

	IDDAmenus[2] = ["p3", p3_left, 135, 145, , "left", 0, "#fbfbd0", "absolute", "hidden",
	, 145, 16, "top", 16, "top", , , , , "dropdowns", , , ,
	["residentialSites.shtml", "Residential Sites", , 17, "no sub", , , "p3_1"],
	["residentialSites.shtml#rossCampus", "Ross Campus", , 20, "level 2", "p3s2", , "p3_2"],
	["residentialSites.shtml#communityHomes", "Community-Based Homes", , 3, "level 2", "p3s3", , "p3_3"]
	];

	IDDAmenus[3] = ["p4", p4_left, 135, 132, , "left", 0, "#fbfbd0", "absolute", "hidden",
	, 132, 48, "top", 48, "top", , , , , "dropdowns", , , ,
	["donate.shtml", "Ways to Donate", , 1, "no sub", , , "p4_1"],
	["donors.shtml", "Donors", , 1, "no sub", , , "p4_2"],
	["onlineDonation.php", "Online Donation Form", , 1, "no sub", , , "p4_3"]
	];

	IDDAmenus[4] = ["p5", p5_left, 135, 114, , "left", 0, "#fbfbd0", "absolute", "hidden",
	, 114, 32, "top", 32, "top", , , , , "dropdowns", , , ,
	["resources.shtml", "Resources", , 11, "no sub", , , "p5_1"],
	["glossary.shtml", "Glossary of Terms", , 1, "no sub", , , "p5_2"]
	];

	IDDAmenus[5] = ["p3s2", p3s_left, p3s2_top, 86, , "left", 0, "#dceae4", "absolute", "hidden",
	, 86, 0, "top", 56, "top", , , 0, , "dropdowns", , , ,
	["petersonHall.shtml", "Peterson Hall", , 1, , , ,"p3s2_1"],
	["popeHall.shtml", "Pope Hall", , 6, , , ,"p3s2_2"],
	["mcIvor-collinsHalls.shtml#collins", "Collins Hall", , 4, , , ,"p3s2_3"],
	["mcIvor-collinsHalls.shtml#mcIvor", "McIvor Hall", , 4, , , ,"p3s2_4"]
	];

	IDDAmenus[6] = ["p3s3", p3s_left, p3s3_top, 96, , "left", 0, "#dceae4", "absolute", "hidden",
	, 92, 0, "top", 148, "top", , , 0, , "dropdowns", , , ,
	["brownDrive.shtml", "Brown Drive", , 5, , , ,"p3s3_1"],
	["circleRoad.shtml", "Circle Road", , 5, , , ,"p3s3_2"],
	["danteHouse.shtml", "Dante House", , 4, , , ,"p3s3_3"],
	["ferrisDrive.shtml", "Ferris Drive", , 5, , , ,"p3s3_4"],
	["lamontHouse.shtml", "Lamont House", , 3, , , ,"p3s3_5"],
	["MillerCreek.shtml", "Miller Creek", , 6, , , ,"p3s3_6"],
	["MicheleCircle.shtml", "Michele Circle", , 2, , , ,"p3s3_7"],
	["NovatoBlvd.shtml", "Novato Blvd", , 6, , , ,"p3s3_8"],
	["secondStreet.shtml", "Second Street", , 3, , , ,"p3s3_9"],
	["walterHouse.shtml", "Walter House", , 4, , , ,"p3s3_10"]
	];



/* submenu example
IDDAmenus[2] = ["p2s1", 456, 35, 220, , "left", 1, "#999999", "absolute", "hidden",
, 216, , , 140, "top", , , , , "menulink1", , "#000044", ,
["services/manage.htm#pm", "Program Management", , , , , ],
["services/manage.htm#cm", "Construction Management", , , , , ],
["services/manage.htm#pp", "Project Planning", , , , , ],
["services/manage.htm#em", "Environmental Management", , , , , ],
["services/manage.htm#ccom", "Contract Close-Out Management", , , , , ]
];
*/


/*
IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,
txw, bxw, lxh, lxv, rxh, rxv, txh, bxh, lxw, rxw, css_class, bordercolor, bordercolorlight, bordercolordark,
[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],
];

" + indent_continue + "
indent_sub_item + 

	IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,
	top_exit_width, bottom_exit_width, left_exit_height, left_exit_valign, right_exit_height, right_exit_valign, top_exit_height,
		bottom_exit_height, left_exit_width, right_exit_width, css_class, bordercolor, bordercolorlight, bordercolordark,
	[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],
	];
*/

function loadMenus() {
	var this_doc = document.getElementById('pagebody');
	var win_width = this_doc.offsetWidth;
	var left_shift = 0;
/*
	if(win_width > page_width) {
		var dbl_shift = (win_width - page_width);
		var mod_dbl_shift = dbl_shift % 2;
		if(mod_dbl_shift >= 0) {dbl_shift--;}
		var mod_dbl_shift = dbl_shift % 2;
		left_shift = dbl_shift/2;
	}

*/
	var id_name, left_pos, top_pos, width, height, justification, border, position, visibility, txw, bxw, lxh,
	lxv, rxh, rxv, txh, bxh, lxw,
	rxw, css_class, bgcolor, bordercolor, bordercolorlight, bordercolordark,
	link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align, img_id;
	var layer_tag = isNav4 ? "layer" : "div";
	var close_layer = "";
	var empty_layer_tag = "";

	if(isNav4) {
		empty_layer_tag = "<layer id='empty_layer'>\n";
		close_layer = "</layer>\n";
	} else {
		empty_layer_tag = "<div id='empty_layer' style='position: absolute; left:0px; top:0px; width:1px; z-index:9; visibility: hidden'>\n";
		close_layer = "</div>\n";
	}

	document.write(empty_layer_tag);
//	document.write("<img src='" + transparent_img + "' height=10 width=10 border='0'>\n");
	document.write(close_layer);

	if(isNav4) {
		document.empty_layer.position = 'absolute'; document.empty_layer.left = 0; document.empty_layer.top = 0;
		document.empty_layer.width = 1; document.empty_layer.visibility = 'hidden';
	}
	
	var next_menu, next_link, top_exit_bar, pad_right, pad_left;
	var left_exit_bar = ""; var right_exit_bar = "";
	var margin_string = ""; fill_string = "";
	var over_action;
	var this_menu = new Array(); var this_link = new Array();
	var this_nav4_menu; var this_layer_tag;
	var close_this_layer; var nav4_menus = new Array();

show_link_cell = 1;
	for(next_menu = 0; next_menu < IDDAmenus.length; next_menu++) {
		this_menu = IDDAmenus[next_menu];
		if(isNav4 && this_menu[0].indexOf("s") > -1) continue; // #####################################################################3
		id_name = this_menu[0]; left_pos = this_menu[1]; top_pos = this_menu[2]; width = this_menu[3];
		height = this_menu[4]; border = this_menu[6]; bgcolor = this_menu[7];
		position = this_menu[8]; visibility = this_menu[9]; txw = this_menu[10]; bxw = this_menu[11];
		lxh = this_menu[12]; lxv = this_menu[13]; rxh = this_menu[14];
		rxv = this_menu[15]; txh = this_menu[16]; bxh = this_menu[17];
		lxw = this_menu[18]; rxw = this_menu[19]; css_class = this_menu[20];
		bordercolor = this_menu[21]; bordercolorlight = this_menu[22]; bordercolordark = this_menu[23];
		if (this_menu[5]) {justification = this_menu[5];}
		height = height ? " height: " + height + ";" : "";
//		lxw = lxw ? lxw : exit_zone;
		lxw = 0;
		rxw = rxw ? rxw : exit_zone;
		txh = txh ? txh : exit_zone;
		bxh = bxh ? bxh : exit_zone;
		rxv = rxv ? " valign='" + rxv + "'" : "";
		lxv = lxv ? " valign='" + lxv + "'" : "";
		bordercolorlight = bordercolorlight ? " bordercolorlight='" + bordercolorlight + "'" : "";
		bordercolordark = bordercolordark ? " bordercolordark='" + bordercolordark + "'" : "";
		bordercolor = bordercolor ? " bordercolor='" + bordercolor + "'" : "";
		left_exit_bar = ""; right_exit_bar = ""; top_exit_bar = "";
		left_pos += left_shift*1;
 // alert('left_pos = ' + left_pos); // ########################
		if(lxh > 0) {
			left_pos -= lxw;
			left_exit_bar = "<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + lxh + " width=" + lxw + " border='0'></a>";
		}
		if(rxh > 0) {
			right_exit_bar = "<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + rxh + " width=" + rxw + " border='0'></a>";
		}
		if(txw > 0) {
			top_pos -= txh;
			top_exit_bar += "	<tr><td></td><td align='left' valign='top'>\n";
			top_exit_bar += "		<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + txh + " width=" + txw + " border='0'></a><br>\n";
			top_exit_bar += "	</td><td></td></tr>\n";
		}

		if(isNav4) {
			this_layer_tag = "<layer id='" + id_name + "' class='" + css_class + "' position='absolute' visibility='hidden' left=" + left_pos + " top=" + top_pos + " width=" + width + ">\n";
			close_this_layer = "</layer>\n";

		} else {
			this_layer_tag = "<div id='" + id_name + "' style='position:" + position + "; left:" + left_pos + "px; top:" + top_pos + "px; width:" + width + "px;" + height + " z-index:9; visibility:" + visibility + "' class='" + css_class + "'>\n";
			close_this_layer = "</div>\n";
		}

		document.write(this_layer_tag);
		// find out if any of the links here has a sub menu
		this_link = new Array();

//		this_link = this_menu[next_link];

		document.write("<table border=0 cellspacing='0' cellpadding='0'>\n");

		if(txw > 0) document.write(top_exit_bar);
		document.write("	<tr>\n");
		document.write("		<td align='left' " + lxv + ">" + left_exit_bar + "</td>\n");
		document.write("		<td align='left' valign='top'>\n");
		document.write("			<table border=0 cellspacing=0 cellpadding=0>\n");
//		document.write("			<table border='" + border + "'" + bordercolor + bordercolorlight + bordercolordark + " cellspacing=0 cellpadding=0>\n");
		document.write("				<tr><td align='left' valign='top'>\n");

		document.write("					<table border=0 cellspacing='0' cellpadding='2' bgcolor='" + bgcolor + "' width=" + width + ">\n");
//		document.write("					<table border=0 cellspacing='0' cellpadding='2' width=" + width + ">\n");

//		document.write("						<tr><td align='left' valign='top' colspan=2>\n");
//		document.write("							<img src='" + transparent_img + "' height=" + top_pad + " width=" + (width - 2) + " border='0'><br>\n");
//		document.write("						</td></tr>\n");

		for(next_link = 24; next_link < this_menu.length; next_link++) {
			this_link = this_menu[next_link]; pad_margin = 0;
			link_name = this_link[0]; link_text = this_link[1];
 			pad_fill = this_link[3] ? this_link[3] : 0; sub_menu = this_link[4]; sub_name = this_link[5];
			pad_margin = this_link[2] ? this_link[2] : margin_padding;
			link_id = this_link[7];
// hideSecondary() would go here if needed

			right_arrow_cell = "";
			second_menu = "";
			if(sub_menu) {
				if(sub_menu == "level 2") {
					arrow_name = (arrow_align == "left") ? "arwlt" : "arwrt";
					arrow_name += sub_name;
					right_arrow_cell = (arrow_align == "left") ? "<td align='right' valgin='top' class='" + css_class + "'><&nbsp;</td>" : "<td align='right' align='top' class='" + css_class + "'>>&nbsp;</td>";
					second_menu = "secondaryMenu('" + sub_name + "', '" + arrow_name + "');";
				} else if(sub_menu == "no sub") {
					second_menu = "hideSecondary(); ";
					right_arrow_cell = "<td></td>";
				}
			}
// alert(right_arrow_cell); // ################################3
		if(id_name.indexOf('s') == 2) {
				bgcolor_over = bgcoloralt_b;
			} else {
				bgcolor_over = bgcoloralt;
			}
			over_action = " onmouseOver=\"" + second_menu + "document.getElementById('tr_" + link_id + "').style.backgroundColor='" + bgcolor_over + "'; document.getElementById('" + link_id + "').style.backgroundColor='" + bgcolor_over + "'; return true;\"";
			margin_string = ""; fill_string = "";
			for(mgnstg = 1; mgnstg <= pad_margin; mgnstg++) {
				margin_string += "&nbsp;";
			}
			for(flstg = 1; flstg <= pad_fill; flstg++) {
				fill_string += "&nbsp;";
			}
			if(justification == "right") {
				pad_left = fill_string;
				pad_right = margin_string;
			} else {
				pad_right = fill_string;
				pad_left = margin_string;

			}
//			right_arrow_cell = "<td><img src='" + transparent_img + "' width=2 border=0></td>";
//			right_arrow_cell = "";
link_cell = "							<td align='" + justification + "' valign='top'><div class='" + css_class + "' style='background-color: " + bgcolor + ";' id='" + link_id + "' " + over_action + " onMouseOut=\"document.getElementById('tr_" + link_id + "').style.backgroundColor='" + bgcolor + "'; document.getElementById('" + link_id + "').style.backgroundColor='" + bgcolor + "'; return true;\"><nobr><a href='" + link_name + "'>" + pad_left + link_text + pad_right + "</a></nobr></div></td>";
			document.write("						<tr id='tr_" + link_id + "'>\n");
			document.write(link_cell);
			document.write("						" + right_arrow_cell + "</tr>\n");
		}

//		document.write("						<tr><td align='left' valign='top' colspan=2>\n");
//		document.write("							<img src='" + transparent_img + "' height=" + bottom_pad + " width=" + (width - 2) + " border='0'><br>\n");
//		document.write("						</td></tr>\n");
		document.write("					</table>\n");
		document.write("				</td></tr>\n");
		document.write("			</table>\n");
		document.write("		</td>\n");
		document.write("		<td align='left' " + rxv + ">" + right_exit_bar + "</td>\n");
		document.write("	</tr>\n");
		document.write("	<tr><td></td><td align='left' valign='top'>\n");
		document.write("		<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + bxh + " width=" + bxw + " border='0'></a><br>\n");
		document.write("	</td><td></td></tr>\n");
		document.write("</table>\n");
//		document.write("</div>\n");

		document.write(close_this_layer);
	}
}



var	current_left = 0;
var	current_top = 0;
var	current_primary = "";
var	current_secondary = "";












function primaryMenu(div_name) {
//	current_rollover = this_img_id;
	var vis_length = visible_divs.length;
	var old_primary, new_primary, old_secondary, old_obj, new_obj;

	if(vis_length == 1) { // a primary menu is open
		if(visible_divs[0] != div_name) {
			// hide the previous primary menu
			if(old_obj=getObject(visible_divs[0])) {
				old_primary=(document.layers)?old_obj:old_obj.style;
				 old_primary.visibility="hidden";
			}
			visible_divs = popOff(visible_divs);
		} else {return;}
	} else if(vis_length == 2) { // both a primary and a secondary menu are open
		// hide the secondary menu
		if(old_obj=getObject(visible_divs[1])) {
			old_secondary=(document.layers)?old_obj:old_obj.style;
			 old_secondary.visibility="hidden";
		}
		visible_divs = popOff(visible_divs);
		if(visible_divs[0] != div_name) {
			// hide the previous primary menu
			if(old_obj=getObject(visible_divs[0])) {
				old_primary=(document.layers)?old_obj:old_obj.style;
				 old_primary.visibility="hidden";
				visible_divs = popOff(visible_divs);
			}
		}
	} else {} // either there are non or how did so many menus get opened?

	if(visible_divs[0] != div_name) {
		if(new_obj=getObject(div_name)) {
			new_primary=(document.layers)?new_obj:new_obj.style;
			 new_primary.visibility="visible";
			 visible_divs[visible_divs.length] = div_name;
		}
	}
}

function secondaryMenu(div_name, arrow_name) {
	var debug = '';
	var vis_length = visible_divs.length;
	var old_secondary, new_secondary, old_obj, new_obj;

	if(vis_length == 1) { // the primary menu only is open
		// just open the secondary menu
	} else if(vis_length == 2) { // both the primary and a secondary menu are open
		// hide the previous secondary menu

		if(visible_divs[1] != div_name) {
			if(old_obj=getObject(visible_divs[1])) {
				old_secondary=(document.layers)?old_obj:old_obj.style;
				 old_secondary.visibility="hidden";
				 visible_divs = popOff(visible_divs);
			}
		} else {return true;}

		// open the new secondary
	} else {

		} // either there are none or how did so many menus get opened?


	if(new_obj=getObject(div_name)) {
		if(document.layers) {
			new_secondary = new_obj;
		} else {
			new_secondary = new_obj.style;
		}

		if(isNav) {
			if(div_name != 'empty_layer') {
				current_left += new_secondary.left*1;
				current_top += new_secondary.top*1;
				current_secondary = div_name;
			}
		}
		 new_secondary.visibility="visible";
		 visible_divs[visible_divs.length] = div_name;
	}

//if(debug.length > 0) {alert("debug: " + debug );} // ##########################################
return true;
}

//var current_rollover = "";
function hideMenus(div_name) {
	var vis_length = visible_divs.length;
	var old_menu, old_obj, next_div, next_arrow;
	var this_div = "";

	if(div_name == 'empty_layer') {
		current_left = 0;
		current_top = 0;
	}
	for(next_div = vis_length - 1; next_div >= 0 ; next_div -= 1) {
		this_div = visible_divs[next_div];
		if(old_obj=getObject(this_div)) {
			if(document.layers) {
				old_menu=old_obj;
			} else {old_menu=old_obj.style;}
			 old_menu.visibility="hidden";
		}
		if(visible_divs.length > 0) {visible_divs = popOff(visible_divs);}
	}
//	if(current_rollover.length > 0) {rollOut(current_rollover); current_rollover = "";}
}

function hideMenus2(div_name) {
	var vis_length = visible_divs.length;
	var old_menu, old_obj, next_div, next_arrow;
	var this_div = "";
	if(div_name == 'empty_layer') {
		current_left = 0;
		current_top = 0;
	}
	for(next_div = vis_length - 1; next_div >= 0 ; next_div -= 1) {
		this_div = visible_divs[next_div];
		if(old_obj=getObject(this_div)) {
			if(document.layers) {
				old_menu=old_obj;
			} else {old_menu=old_obj.style;}
			 old_menu.visibility="hidden";
		}
		if(visible_divs.length > 0) {visible_divs = popOff(visible_divs);}
	}
}

function hideSecondary() {
	var vis_length = visible_divs.length;
	var old_secondary, old_obj, next_arrow, next_vis;

	if(vis_length > 2) {
		for(next_vis = vis_length - 1; next_vis > 1; next_vis -= 1) {
			// hide the previous secondary menu
			if(old_obj=getObject(visible_divs[next_vis])) {
				old_secondary=(document.layers)?old_obj:old_obj.style;
				 old_secondary.visibility="hidden";
			}
			visible_divs = popOff(visible_divs);
		}
	}
	if(vis_length == 2) { // both the primary and a secondary menu are open
		// hide the previous secondary menu
		if(old_obj=getObject(visible_divs[1])) {
			old_secondary=(document.layers)?old_obj:old_obj.style;
			 old_secondary.visibility="hidden";
			 visible_divs = popOff(visible_divs);
		}
	}
}

function showVisList() {
	var vis_length = visible_divs.length;
	var next_vis, next_arrow;
	var vis_string = "";
	for(next_vis = 0; next_vis < vis_length; next_vis++) {
		vis_string += visible_divs[next_vis] + "\n";
	}
}


function getObject(n, d) { 
  var p,i,x;
  if(!d) {d=document;}
//  if((p=n.indexOf("?"))>0&&parent.frames.length) {
//    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
//	}

	if(isNav) {
		x = d[n];
	} else {
		x = d.all[n];
	}

  if(!(x=d[n])&&d.all) x=d.all[n];// for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0; !x && d.layers && i < d.layers.length; i++) {
	  x=getObject(n,d.layers[i].document);
  }
  if(!x && d.getElementById) {
	  x=d.getElementById(n);
  }
  return x;
}

function getObject2(n, d) { 
  var p,i,x, y;
  if(!d) {d=document;}
//  if((p=n.indexOf("?"))>0&&parent.frames.length) {
//    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
//	}

	if(isNav) {
		x = d[n];
	} else {
		x = d.all[n];
	}

  if(!(x=d[n])&&d.all) x=d.all[n];// for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0; !x && d.layers && i < d.layers.length; i++) {
	  x=getObject(n,d.layers[i].document);
  }
  if(!x && d.getElementById) {
	  x=d.getElementById(n);
  }
  return x;
}


isNav = false;
isNav4 = false;

function set_nav() { 
  with (navigator) {
	  if (appName == "Netscape") {
		  isNav = true;
		  if(appVersion.indexOf('4.') != -1) {
			  isNav4 = true;
		  }
//    		document.page_width=innerWidth; document.page_height=innerHeight; onresize=set_nav;
		}
	}
}

function popOff(in_array) {
	var new_array = new Array();
	var array_length = in_array.length;
	for(next_el = 0; next_el < array_length-1; next_el++) {
		new_array[next_el] = in_array[next_el];
	}
	in_array = new_array;
	return new_array;
}

set_nav();