// JavaScript Document

// EMAIL FUNCTION

function JSMailTo(email_username,email_domain){
			var email_address=email_username+'@'+email_domain;
			document.write('<a href="mailto:'+email_address+'">'+email_address+'</a>');
}

// ROLLOVER SCRIPT

var d=document;
d.Id=function(x){return this.getElementById(x)}
d.dE=d.documentElement;
var undefined='undefined';

function menuItemMouseEvents(id,url,imgOver,imgOut){
	d.Id(id).onclick=function(){d.location.href=url;}
	d.Id(id).onmouseover=function(){d.Id(id).style.backgroundImage='url('+imgOver+')';}
	d.Id(id).onmouseout=function(){d.Id(id).style.backgroundImage='url('+imgOut+')';}
}
function declareMenuEvents(curPage){
	var numMenuItems=5;
	var page=new Array();
	page.length=numMenuItems+1;
			page[1]='accommodations.php';
			page[2]='http://www.staybridge.com/h/d/sb/1/en/hotel/pdlfs?_requestid=449168';
			page[3]='restaurant.php';
			page[4]='photos.php';
			page[5]='local.php';
		for(i=1; i<numMenuItems+1; i++){
		if(curPage==i){
			d.Id('nav'+i).style.backgroundImage='url(images/nav'+i+'_over.gif)';
		} else {
			menuItemMouseEvents('nav'+i,page[i],'images/nav'+i+'_over.gif','images/nav'+i+'_norm.gif');
		}
	}
}
