//POPUP CODE

var reservationWindow=null;
function reservation(mypage,myname,w,h,pos,infocus){

if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';reservationWindow=window.open('',myname,settings);
if(infocus=='front'){reservationWindow.focus();reservationWindow.location=mypage;}
if(infocus=='back'){reservationWindow.blur();reservationWindow.location=mypage;reservationWindow.blur();}

}

//STUFF FOR NAVIGATION

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_nav_building_over = newImage("images/home-nav-building-over.gif");
		home_nav_tenant_over = newImage("images/home-nav-tenant-over.gif");
		home_nav_space_over = newImage("images/home-nav-space-over.gif");
		home_nav_amenities_over = newImage("images/home-nav-amenities-over.gif");
		home_nav_contact_over = newImage("images/home-nav-contact-over.gif");
		preloadFlag = true;
	}
}

//END STUFF FOR NAVIGATION

//STUFF FOR ANNOUNCEMENTS

if (document.all || document.getElementById){ //if IE4 or NS6+
document.write('<style type="text/css">\n')
document.write('.dyncontent{display: none; width: 340px; height: 70px;}\n')
document.write('</style>')
}

var curcontentindex=0
var messages=new Array()

function getElementByClass(classname){
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
messages[inc++]=alltags[i]
}
}

function rotatecontent(){
//get current message index (to show it):
curcontentindex=(curcontentindex<messages.length-1)? curcontentindex+1 : 0
//get previous message index (to hide it):
prevcontentindex=(curcontentindex==0)? messages.length-1 : curcontentindex-1
messages[prevcontentindex].style.display="none" //hide previous message
messages[curcontentindex].style.display="block" //show current message
}


window.onload=function(){
if (document.all || document.getElementById){
getElementByClass("dyncontent")
setInterval("rotatecontent()", 10000) //THIS IS THE MILLISECONDS THAT EACH ANNOUNCEMENT STAYS VISIBLE
}
}

//END STUFF FOR ANNOUNCEMENTS