var sh;
if (self.innerHeight) // all except Explorer
{
	sh = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	sh = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	sh = document.body.clientHeight;
}

function init() {
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		ph = document.body.scrollHeight;
	}
	else // Explorer Mac;
		 //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		ph = document.body.offsetHeight;
	}

	ph = (ph < 450) ? 450 : ph;
	window.parent.sizeMe(ph);
}

function showFloor(n) {
	document.getElementById("mainFloorFrame").src = "current-projects/basic" + n + ".htm";
	document.getElementById("floorContainer").style.visibility = "visible";
	document.getElementById("mapShadow").style.visibility = "visible";
	document.getElementById("floorTabs").style.visibility = "visible";
}

function hideFloor() {
	document.getElementById("mapShadow").style.visibility = "hidden";
	document.getElementById("floorContainer").style.visibility = "hidden";
	document.getElementById("floorTabs").style.visibility = "hidden";
	document.getElementById("officeTabs").style.visibility = "hidden";
}

function showApartment(n) {
	document.getElementById("mainApartmentFrame").src = "current-projects/idiv-lofts/" + n + ".htm";
	document.getElementById("shield3").style.visibility = "visible";
	document.getElementById("apartmentContainer").style.visibility = "visible";
	document.getElementById("apartmentShadow").style.visibility = "visible";
}

function hideApartment() {
	document.getElementById("apartmentShadow").style.visibility = "hidden";
	document.getElementById("apartmentContainer").style.visibility = "hidden";
	document.getElementById("shield3").style.visibility = "hidden";
}

function reserveLoft() {
	document.getElementById("contentFrame").src = "lease-application/lease-ap.php";
	hideApartment();
	hideFloor();
}

function loadFloor(flizzoor) {
	document.getElementById("mainFloorFrame").src = "current-projects/" + flizzoor;
}

function loadOffice() {
	document.getElementById("mainFloorFrame").src = "current-projects/basic-office-retail.htm";
	document.getElementById("floorContainer").style.visibility = "visible";
	document.getElementById("mapShadow").style.visibility = "visible";	
	document.getElementById("officeTabs").style.visibility = "visible";
}

function goHome() {
	document.getElementById("contentFrame").src = "current-projects/thearbaugh.htm";
}

function goContact() {
	document.getElementById("contentFrame").src = "current-projects/contact.htm";
} 

function goApp(fl) {
	hideFloor();
	hideApartment();
	document.getElementById("contentFrame").src = "lease-application/lease-ap.php?f=" + fl;
}

function showMap() {
	document.getElementById("mapContainer").style.visibility = "visible";
	document.getElementById("mapClose").style.visibility = "visible";
}

function hidethMappy() {
	document.getElementById("mapContainer").style.visibility = "hidden";
	document.getElementById("mapClose").style.visibility = "hidden";
}

function comeOutOfCloset() {
	document.getElementById("closetContainer").style.visibility = "visible";
	document.getElementById("closetShadow").style.visibility = "visible";
}

function goBackInCloset() {
	document.getElementById("closetContainer").style.visibility = "hidden";
	document.getElementById("closetShadow").style.visibility = "hidden";
}

function popLoft(id)
{	
	left = parseInt((sh - 420) / 2);
	win = window.open("/current-projects/loftdetails.php?x=" +  id,"ArbaughLoft","width=650,height=600,left=" + left + ",scrollbars=no");
}

