// JavaScript Document
<!--
function flashHP(mySwf){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="367px" height="313px">\n<param name="movie" value="swf/' + mySwf + '">\n<param name="wmode" value="transparent">\n<param name=quality value="high">\n<param name=menu value="false"\n<embed src="swf/' + mySwf + '" quality="high" style="z-index:inherit  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" value="transparent" wmode="transparent" width="367px" height="313px"></embed>\n</object>');
}	

function swf2(mySwf){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="478px" height="219px">\n<param name="movie" value="../swf/' + mySwf + '">\n<param name="wmode" value="transparent">\n<param name=quality value="high">\n<param name=menu value="false"\n<embed src="../swf/' + mySwf + '" quality="high" style="z-index:inherit  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" value="transparent" wmode="transparent" width="478px" height="219px"></embed>\n</object>');
}	



function emailClick(emailID,emailContent){
	var currentContent=document.getElementById(emailID).value;	
	if (currentContent==emailContent) {
		document.getElementById(emailID).value="";
		document.getElementById(emailID).style.fontStyle="normal";				
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);

}
function goLocation( thisFormSelect ){
  var thisSelection = thisFormSelect.options[thisFormSelect.selectedIndex].value;
  if (thisSelection != "") {
    location = thisSelection;
  }
}
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function newWin(x){
window.open(x, "", "")
} 

function openNewWindow() {
  popupWin = window.open('best.htm',
  'best',
  'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent=no, width=450, height=330, left=0, top=0')
}
function best(){
  window.open('../best.htm',
  'best',
  'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent=no, width=450, height=330, left=0, top=0')
  window.close();
}
function openNewWindowTerms() {
  popupWin = window.open('terms.htm',
  'terms',
  'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent=no, width=450, height=330, left=0, top=0')
}
function openNewWindowTour() {
  popupWin = window.open('tours/1.htm',
  'tours',
  'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent=no, width=780, height=395')
}
function hiRes() {
  popupWin = window.open('http://www.coastalhotels.com/press.php#chateauavalon',
  'hiRes',
  'menubar=yes, toolbar=yes, location=yes, directories=yes, status=yes, scrollbars=yes, resizable=yes, dependent=yes')
}


function goLink(x, y){
if(!x){return false}
y == "newWin" ? window.open(x, "", "") : self.location = x
document.getElementById("select1").selectedIndex = 0
}

function BBclearMenus() {
	for (i = 1; i <= 9; i++) {
		var elementID = "menu" + i;
		document.getElementById(elementID).style.visibility="hidden";
	}
}

var theTimeout;
function showmenu(menuNum){
	var elmnt = "menu" + menuNum;
	BBclearMenus();
	clearTimeout(theTimeout);
	document.getElementById(elmnt).style.visibility="visible";
}

function hidemenu(menuNum){
	var elmnt = "menu" + menuNum;
	theTimeout = setTimeout('document.getElementById("' + elmnt + '").style.visibility="hidden"',1000);
}
	
function BBmenuOver(menuNum) {
	var elmnt = "menu" + menuNum;
	document.getElementById(elmnt).className="menuItemOverClass";
}

function BBmenuOut(menuNum)  {
	var elmnt = "menu" + menuNum;
	document.getElementById(elmnt).className="menu";
}

function BBmenuClick(myLocation) {
	window.location=myLocation;
}	
function BB_navMO(menuNum) {
	var myDiv = "nav" + menuNum;
	var x=document.getElementById(myDiv);
	showmenu(menuNum);
}

function BB_navMOut(menuNum) {
	var myDiv = "nav" + menuNum;
	var x=document.getElementById(myDiv);
	hidemenu(menuNum);
}

var message = "Print this Page";

function printpage() {
	window.print();  
}
function bookNow(url){
	window.opener.location=url
	window.close();
}
function remote2(url){
	window.opener.location=url
}
function remote3(URL,newWindow) {
		if (window.opener && !window.opener.closed && !newWindow) {
			window.opener.location=URL; 
		}
		else {
			window.open(URL,'_blank', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
		}		
		window.close();
	}

function remote4(URL,newWindow) {
		if (window.opener && !window.opener.closed && !newWindow) {
			window.opener.location=URL; 
		}
		else {
			window.open(URL,'_blank', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
		}		
		window.close();
	}

function bookClick(URL,newWindow) {
		if (window.opener && !window.opener.closed && !newWindow) {
			window.opener.location=URL; 
		}
		else {
			window.open(URL,'_blank', 'toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
		}		
		window.close();
	}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

function signup () {
	var myCount=getCookie('signupCount');
	if (myCount == "") {myCount = 0;}

	if (myCount > 1) {
		document.signup.style.visibility = "visible";
	}
	else {
		++myCount;
		setCookie ('signupCount',myCount,30);
	}
}