// JavaScript Document

//function TCpopUp(URL) {
//	day = new Date();
//	id = day.getTime();
//	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=250,left = 362,top = 259');");
//}

function TCpopUp(URL,myheight) {
	window.open(URL, 'CHGTC', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=325,height=' + myheight + ',left=362,top=259');
	}

function dcsonloadperm(){
		signup();
}
	function dcsonunloadperm(){
		k=4;
			
	}
	
	function testbox(){
		alert("This is a test")
}
	

function emailClick(emailID,emailContent){
	var currentContent=document.getElementById(emailID).value;	
	if (currentContent==emailContent) {
		document.getElementById(emailID).value="";
		document.getElementById(emailID).style.fontStyle="normal"; 		
	}
}


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 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="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 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 <= 14; 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 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) {
	   if (document.getElementById("signup") != null) {
			document.signup.style.visibility = "visible";
	   }
	}
	else {
		++myCount;
		setCookie ('signupCount',myCount,30);
	}
}


function jload () {
	signup();

}

function junload () {
}
function openNewWindowTour() {
  popupWin = window.open('http://www.lodgeonthedesert.com/tours/1.htm',
  'tours',
  'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=yes, dependent=no, width=780, height=410')
}


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 hiRes() {
  popupWin = window.open('http://www.coastalhotels.com/desert.php',
  'hiRes',
  'menubar=yes, toolbar=yes, location=yes, directories=yes, status=yes, scrollbars=yes, resizable=yes, dependent=yes')
}

function openNewWindow() {
  popupWin = window.open('best_rate.php',
  '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_rate.php',
  '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();
}

