
function addToFavorites()
{ 
if (window.sidebar) {alert("Sorry! Your browser doesn't support this function.\nPress Ctrl+D to add site to bookmark list."); return;}
if (window.external) { window.external.AddFavorite(document.location.href + "?WT.cg_n=bookmarkreturn",document.title); return;}
else  { alert("Sorry! Your browser doesn't support this function.\nPress Ctrl+D to add site to bookmark list."); } }


function popup(url, width, height, scrollable)
{ if(scrollable){scbars = 1;} else{scbars = 0;} var nomargin; if(scrollable == 2){ nomargin = true; scbars = 0; }
  if(url == "ecap"){ url="http://www.secure-res.com/emgr/csemail.asp?ID="+width; width=400; height = 455;}
  if(url == "srlogo"){ width = 445; height = 455; url="http://www.hotelwebsitedesign.com/secureres/srpopup/"}
  if(url == "stf"){ if(height==1){height=200;} if(!height){height=0;} url="http://www.secure-res.com/emgr/stf/sendpage.asp?pg="+location.href+"&id="+width; width = 560; height += 100;   }
  var wopt = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+ scbars +",resizable=0,width="+width+",height="+height+",top="+(screen.height/2-height/2)+",left="+(screen.width/2 - width/2)
  if(nomargin){ newwin=window.open("","",wopt);	newwin.document.write("<html><head><style>body{margin:0}</style></head><body><img src='"+ url +"'></body></html>");  }
  else { newwin=window.open(url,"popup",wopt); }			
  newwin.focus(); }
  
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=0,location=1,statusbar=1,menubar=1,resizable=0,width=580,height=470,left = 350,top = 277');");
}


function generate_address( un, hn, sty, lnk, subline) 
{ var stycl = ""; var atsign = "&#64;"; var subject = "";
  var addr = un + atsign + hn;
  if(sty){stycl = " class=" + sty } if(subline){subject = "?Subject=" + subline } 
  if(!lnk){ var lnk = addr; } 
  document.write( "<" + "a " + stycl + " href='" + "mail" + "to:" + addr + subject +"'>" + lnk + "</a>");	}

var wmonths = ["Jan","Feb","Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 

function do_opt(numopts,startnum,selnum)
{ if(!startnum && startnum != 0){startnum=1} 
  if(numopts == "mo"){ for (var xi=0; xi<wmonths.length; xi++) { document.write('<option value=' + (xi+1) + '>' + (wmonths[xi])); } }
  else { for (var xi=startnum; xi<=numopts; xi++) { sel=(selnum == xi)?" selected ":""; document.write('<option value=' + (xi) + sel + '>' + (xi) ); } }
}


//  DROPDOWN MENU ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //

addEvent(window,'load',menu,false);

function menu()
{
	activateMenu('nav');	
}

activateMenu = function(nav)
{
	var navroot = document.getElementById(nav);	
	var lis=navroot.getElementsByTagName("LI");
	
	for (i=0; i<lis.length; i++)
	{
		var uls = lis[i].childNodes;		
		for (c=0; c<uls.length; c++)
		{
			if (uls[c].tagName=="UL")
			{
				lis[i].className+=" sub";
			}
		}
		
		if (document.all && document.getElementById(nav).currentStyle)
		{  
			lis[i].onmouseover=function()
			{	
			   this.className+=" over";
			}
			lis[i].onmouseout=function()
			{                       
			   this.className=this.className.replace(" over", "");
			}
		}

	}
}


// DIV TOGGLE --------------------------------------------------- //


currentdiv = 'div1'

function dtoggle(newdiv)
{ document.getElementById(currentdiv).style.display = "none";  
  document.getElementById(newdiv).style.display = "block";
  document.getElementById(currentdiv + "_b").className = "classoff"
  document.getElementById(newdiv + "_b").className = "classon"
  currentdiv = newdiv; }
  
  

function addEvent(elm, evType, fn, useCapture)
{
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else {
		elm['on' + evType] = fn;
	}
}  



addEvent(window,'load',sitemapPopup,false);

/* 
	Modify the linkID and popupID to match the ID's you used in the html.
*/
function sitemapPopup()
{
	var linkID 	= "sitemapLink";
	var popupID	= "sitemapDiv";
	
	var linker = document.getElementById(linkID);
	var popup = document.getElementById(popupID);
	
	//removes the popup from wherever it is and places it as a child
	//under the link element so that it can be positioned relative to it
	popup.parentNode.removeChild(popup);
	linker.appendChild(popup);
	
	linker.onmouseover = function()
	{	var popup = document.getElementById("sitemapDiv")
		popup.style.display = "block";	}
	
	linker.onmouseout = function()
	{	var popup = document.getElementById("sitemapDiv")
		popup.style.display = "none";	}
	
	popup.onmouseover = function()
	{	this.style.display = "block";	}
	
	popup.onmouseout = function()
	{	this.style.display = "none";	}
}

function addEvent(elm, evType, fn, useCapture)
{
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;	}
	else {	elm['on' + evType] = fn;	}
}

currentdiv = 'div1'

function dtoggle(newdiv)
{ document.getElementById(currentdiv).style.display = "none";  
  document.getElementById(newdiv).style.display = "block";
  document.getElementById(currentdiv + "_b").className = "classoff"
  document.getElementById(newdiv + "_b").className = "classon"
  currentdiv = newdiv; }
  
  
  
  
  
function showBook () {
//javascript:scroll(0,0);
document.getElementById('ibe').style.display='block';
//document.forms.checkaressrch.style.visibility = 'hidden';
/*if (window.XMLHttpRequest) {
document.documentElement.style.overflow='hidden';}
else {
document.body.style.overflow='hidden';}*/
}

function hideBook () {
//javascript:scroll(0,0);
document.getElementById('ibe').style.display='none';
//document.forms.checkaressrch.style.visibility = 'visible';
/*if (window.XMLHttpRequest) {
document.documentElement.style.overflow='auto';}
else {
document.body.style.overflow='visible';}
*/
}  

function openVRXVT(ID)
{
    var win = window.open('http://delivery.vrxstudios.com/50078/VirtualTours.htm?id_type=2&id=' + ID,'VrxStudiosPopUp','height=520,width=370,scrollbars=no,toolbar=no,menubar=no');
    win.focus();
}
function openVRXStill(ID)
{
    var win = window.open('http://delivery.vrxstudios.com/50078/Stills.htm?id_type=2&id=' + ID,'VrxStudiosPopUp','height=520,width=370,scrollbars=no,toolbar=no,menubar=no');
    win.focus();
}
