//javascript for CSS menus
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;
//MM functions for rollover
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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(!(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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//end MM functions

MM_preloadImages('global/gui/images/home_ov.gif','global/gui/images/building_info_ov.gif','global/gui/images/building_services_ov.gif','global/gui/images/available_space_ov.gif','global/gui/images/available_space_ov.gif','global/gui/images/tenant_request_ov.gif','global/gui/images/contact_us_ov.gif');

function drawMainNav(selected) {
	if (selected == void(0)) {selected = -1;}
	htmlBuff = "<div id=\"menu\" style=\"z-index:10\">";
	htmlBuff = htmlBuff+"<table width=\"100%\" height=\"31\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
	htmlBuff = htmlBuff+"<tr>";
	//htmlBuff = htmlBuff+"<td valign=\"middle\" background=\"global/gui/images/nav_left.gif\" style=\"background-repeat:repeat-x\">";
	htmlBuff = htmlBuff+"<td valign=\"middle\">";
	htmlBuff = htmlBuff+"<ul id=\"nav\">";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"index.html\"><img src=\"global/gui/images/home_up.gif\" width=\"63\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 0) {
	htmlBuff = htmlBuff+"<div><a href=\"index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('home','','global/gui/images/home_ov.gif',1)\"><img src=\"global/gui/images/home_sel.gif\" alt=\"Home\" name=\"home\" width=\"63\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('home','','global/gui/images/home_ov.gif',1)\"><img src=\"global/gui/images/home_up.gif\" alt=\"Home\" name=\"home\" width=\"63\" height=\"31\" border=\"0\"></a></div>";
	}
htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"information.html\"><img src=\"global/gui/images/building_info_up.gif\" width=\"167\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 1) {	
	htmlBuff = htmlBuff+"<div><a href=\"information.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('bldginfo','','global/gui/images/building_info_ov.gif',1)\"><img src=\"global/gui/images/building_info_sel.gif\" alt=\"Building Info\" name=\"bldginfo\" width=\"167\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"information.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('bldginfo','','global/gui/images/building_info_ov.gif',1)\"><img src=\"global/gui/images/building_info_up.gif\" alt=\"Building Info\" name=\"bldginfo\" width=\"167\" height=\"31\" border=\"0\"></a></div>";
	}
	
	htmlBuff = htmlBuff+"<ul>";
	htmlBuff = htmlBuff+"<li><a href=\"information.html\">Building History</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_facts.html\">Building Facts</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_find.html\">How To Find Us</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_parking.html\">Parking & Transportation</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_management.html\">Building Management</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_man_profiles.html\">Staff Profiles</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_amenities.html\">Amenities</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"info_rules.html\">Building Rules</a></li>";
	htmlBuff = htmlBuff+"</ul>";
	htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"services.html\"><img src=\"global/gui/images/building_services_up.gif\" width=\"139\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 2) {	
	htmlBuff = htmlBuff+"<div><a href=\"services.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('bldgservices','','global/gui/images/building_services_ov.gif',1)\"><img src=\"global/gui/images/building_services_sel.gif\" alt=\"Building Services\" name=\"bldgservices\" width=\"139\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"services.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('bldgservices','','global/gui/images/building_services_ov.gif',1)\"><img src=\"global/gui/images/building_services_up.gif\" alt=\"Building Services\" name=\"bldgservices\" width=\"139\" height=\"31\" border=\"0\"></a></div>";
	}

	htmlBuff = htmlBuff+"<ul>";
	htmlBuff = htmlBuff+"<li><a href=\"services.html\">Building Services</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_management.html\">Management Services</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_maintenance.html\">Maintenance Services</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_custodial.html\">Custodial</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_emergency.html\">Emergency Information</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_security.html\">Security</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_telecommunications.html\">Telecommunication</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_freight.html\">Freight Usage</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"serv_operation.html\">Hours of Operation</a></li>";
	htmlBuff = htmlBuff+"</ul>";
	htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"space.html\"><img src=\"global/gui/images/available_space_up.gif\" width=\"123\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 3) {	
	htmlBuff = htmlBuff+"<div><a href=\"space.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('availspace','','global/gui/images/available_space_ov.gif',1)\"><img src=\"global/gui/images/available_space_sel.gif\" alt=\"Available Space\" name=\"availspace\" width=\"123\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"space.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('availspace','','global/gui/images/available_space_ov.gif',1)\"><img src=\"global/gui/images/available_space_up.gif\" alt=\"Available Space\" name=\"availspace\" width=\"123\" height=\"31\" border=\"0\"></a></div>";
	}
	
	htmlBuff = htmlBuff+"<ul>";
	htmlBuff = htmlBuff+"<li><a href=\"space.html\">Available Space</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"space_contact.html\">Contact Us About Space</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"space_properties.html\">Related Properties</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"space_parking.html\">Parking and Transportation</a></li>";
	htmlBuff = htmlBuff+"</ul>";
	htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"tenant.html\"><img src=\"global/gui/images/tenant_request_up.gif\" width=\"125\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 4) {	
	htmlBuff = htmlBuff+"<div><a href=\"tenant.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('tenantrequest','','global/gui/images/tenant_request_ov.gif',1)\"><img src=\"global/gui/images/tenant_request_sel.gif\" alt=\"Tenant Requests\" name=\"tenantrequest\" width=\"125\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"tenant.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('tenantrequest','','global/gui/images/tenant_request_ov.gif',1)\"><img src=\"global/gui/images/tenant_request_up.gif\" alt=\"Tenant Requests\" name=\"tenantrequest\" width=\"125\" height=\"31\" border=\"0\"></a></div>";
	}
	
	htmlBuff = htmlBuff+"<ul>";
	htmlBuff = htmlBuff+"<li><a href=\"tenant.html\">Tenant Requests</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"request_login.cfm\">Facilities Manager Login</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"request_room.html\">Conf Room Reservations</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"request_work.cfm\">Work Order Requests</a></li>";
	htmlBuff = htmlBuff+"<li><a href=\"request_card.cfm\">Card Access Requests</a></li>";
	htmlBuff = htmlBuff+"</ul>";
	htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"<li>";
	//htmlBuff = htmlBuff+"<div><a href=\"contact.html\"><img src=\"global/gui/images/contact_us_up.gif\" width=\"99\" height=\"31\" border=\"0\"></a></div>";
	if (selected == 5) {				
	htmlBuff = htmlBuff+"<div><a href=\"contact.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('contactus','','global/gui/images/contact_us_ov.gif',1)\"><img src=\"global/gui/images/contact_us_sel.gif\" alt=\"Contact Us\" name=\"contactus\" width=\"99\" height=\"31\" border=\"0\"></a></div>";
	} else {
	htmlBuff = htmlBuff+"<div><a href=\"contact.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('contactus','','global/gui/images/contact_us_ov.gif',1)\"><img src=\"global/gui/images/contact_us_up.gif\" alt=\"Contact Us\" name=\"contactus\" width=\"99\" height=\"31\" border=\"0\"></a></div>";
	}
	
	htmlBuff = htmlBuff+"</li>";
	htmlBuff = htmlBuff+"</ul>";
	htmlBuff = htmlBuff+"</td>";
	htmlBuff = htmlBuff+"</tr>";
	htmlBuff = htmlBuff+"</table>";
	htmlBuff = htmlBuff+"</div>";
	document.write(htmlBuff);
}
