//window.onresize = setSpacerHeight;
//not currently used
function setSpacerHeight() {
	if (self.innerWidth){
		h = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientWidth){
		h = document.documentElement.clientHeight;
	}else if (document.body){
		h = document.body.clientHeight;
	}
	document.images["gif"].height = h - 53;
}
//direct user to contact form, with appropriate message inserted into the form
function sendToForm(roomNumber, officeName) {
	switch(roomNumber){
		case "vo":
		window.location = "/cgi-bin/contact_me.pl?message=I am interested in renting a virtual office at 64 Knightsbridge.";
		break;
		case "so":
		window.location = "/cgi-bin/contact_me.pl?message=I am interested in renting serviced office space at 64 Knightsbridge.";
		break;
		case "mr":
		window.location = "/cgi-bin/contact_me.pl?message=I am interested in renting meeting room space at 64 Knightsbridge.";
		break;
		case "cc":
		window.location = "/cgi-bin/contact_me.pl?message=I am interested in learning about your conference facilities at 64 Knightsbridge.";
		break;
		case "gq":
		window.location = "/cgi-bin/contact_me.pl?message=I would like to learn more about the services provided by 64 Knightsbridge.";
		break;
		default:
		window.location = "/cgi-bin/contact_me.pl?message=I am interested in renting room number " + roomNumber + ", on the '" + officeName + "' floor.";
		break;
	}
}
//functions to highlight correct menu item dynamically. No extra code is required on each page ... thanks S!
function setSubMenu(which) {
	document.getElementById(which).className="sub_active";
}
var folder = false;
function setPage(){
var page = location.href;
page = page.replace('http://'+document.domain,'');
//
 var menu_length = document.getElementById("menu_items").childNodes.length;
	for(i=0;i<menu_length;i++){
		var theLink = document.getElementById("menu_items").childNodes[i].childNodes[0].href;
		if(theLink.indexOf(page) != -1 && theLink.indexOf(".html") == -1){
			folder = true;
			//if this is the homepage, only highlight the first menu item (without this, none are highlighted)
			if(page == "/"){
				if(document.getElementById("menu_items").childNodes[i].className == "one"){
					document.getElementById("menu_items").childNodes[i].className="top_active";
				}
			}else{
				document.getElementById("menu_items").childNodes[i].className="top_active";
			}
		}
		if(!folder){
			if(theLink.indexOf(page) != -1){
				document.getElementById("menu_items").childNodes[i].className="sub_active";
			}
		}
	}
}
