if (document.images){



        booktickets = new Image();

        booktickets.src = "images/fantasy_bookticks_01_03-off.jpg";

        bookticketsover = new Image();

        bookticketsover.src = "images/fantasy_bookticks_01_03-on.jpg"; 

        

        search = new Image();

        search.src = "images/fantasy_search_02_03-off.jpg";

        searchover = new Image();

        searchover.src = "images/fantasy_search_02_03-on.jpg"; 

        

        booknow = new Image();

        booknow.src = "images/fantasy_search_03_03-off.jpg";

        booknowover = new Image();

        booknowover.src = "images/fantasy_search_03_03-on.jpg"; 

        

        register = new Image();

        register.src = "images/fantasy_register_03-off.jpg";

        registerover = new Image();

        registerover.src = "images/fantasy_register_03-on.jpg"; 




}



function over(name){

        if (document.images){

                document[name].src = eval(name + "over.src");

        }

}



function off(name){

        if (document.images){

                document[name].src = eval(name + ".src");

        }

}





function popup(pagename,name,width,height) {



	var popup = window.open(pagename,name,"toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizeable=no,width="+width+",height="+height+",left=0,top=0");



    popup.focus();

}

// JavaScript Document

// DHTML Menu function 7/13/05 v2.1 - DG/RCS. Returns X & Y position used for DHTML menu.
function getElement(id) { 
return document.all ? document.all(id) : 
document.getElementById ? document.getElementById(id) : 
document.layers ? document.layers[id] : 
null; 
} 

function findx(eElement, loc)
{
	var posleft = 0;
	var iobj;
	// Handle NS 4
	if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4)  //Navigator 4 handled separately
	{
		 iobj = document.anchors.NN.x;
		 posleft = iobj;
	} else {
	// Handle IE + NS6
  		  posleft = eElement.offsetLeft;          // initialize var to store calculations
   		 var eParElement = eElement.offsetParent;     // identify first offset parent element  
  		  while (eParElement != null)
  		  {                                            // move up through element hierarchy
   		     posleft += eParElement.offsetLeft;      // appending left offset of each parent
   		     eParElement = eParElement.offsetParent;  // until no more offset parents exist
  		  }
	}
	
	if (loc==1) {return posleft+5;} //ACCOMMODATIONS
	else if (loc==2) {return posleft+88;} //DINING
	else if (loc==3) {return posleft+169;} //AMENITIES
	else if (loc==4) {return posleft+240;} //ENTERTAINMENT
	else if (loc==5) {return posleft+335;} //GAMING
	else if (loc==6) {return posleft+385;} //WEDDINGS
	else if (loc==7) {return posleft+445;} //MEETINGS
	return false;
	//(document.layers)
}
function findy(eElement, loc)
{
	var postop = 0;
	var iobj;
	// Handle NS 4
	if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4)  //Navigator 4 handled separately
	{
		 iobj = document.anchors.NN.y;
		 posleft = iobj;
	} else {
	// Handle IE + NS6
  		  postop = eElement.offsetTop;          // initialize var to store calculations
   		 var eParElement = eElement.offsetParent;     // identify first offset parent element  
  		  while (eParElement != null)
  		  {                                            // move up through element hierarchy
   		     postop += eParElement.offsetTop;      // appending left offset of each parent
   		     eParElement = eParElement.offsetParent;  // until no more offset parents exist
  		  }
	}
	
	if (loc==1) {return postop+13;} // ACCOMMODATIONS
	else if (loc==2) {return postop+13;} //DINING
	else if (loc==3) {return postop+13;} //AMENITIES
	else if (loc==4) {return postop+13;} //ENTERTAINMENT
	else if (loc==5) {return postop+13;} //GAMING
	else if (loc==6) {return postop+13;} //WEDDINGS
	else if (loc==7) {return postop+13;} //MEETINGS
	return false;
	//(document.layers)
}

// DW Rollover
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_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_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 SetStatusbar(msg){
	window.status=msg;
	return true;
}


// NEW BOOK GUI Script

function changeNumberNights(intNights, field, show, hide){
	var myTextBox;
	myTextBox = document.getElementById(field);
	myTextBox.value = intNights;
	document.getElementById(hide).style.display = "none";
	if (show != ''){document.getElementById(show).style.display= "block";};
}

function showNights(element,hide){
document.getElementById(element).style.display="block";
//if (hide != ''){document.getElementById(hide).style.display="none";};
}

// Bookgui RoomWin
function RoomWin(theURL,ad,nights) { 
if (theURL == '') { theURL = 'https://reservations.mgmmirage.com/bookingengine.aspx?host=hotel&pid=190'; }
if (ad!=''){ theURL = theURL + "&ad=" + ad;}
if (nights!=''){theURL = theURL + "&nights=" + nights;}
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
winProp = 'width=795,height=460,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
Win = window.open(theURL,'resWin',winProp);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

// SET COOKIE FLASH MUSIC
function setCookie(name, value, expire) {

today = new Date ();
var expires = new Date();
if (expire == "today") {
expires.setTime(today.getTime() + 1000*60*60*24);
expire = null;
}else if (expire == null) {
	expires.setTime(today.getTime() + 1000*60*60*24*365);
}
   document.cookie = name + "=" + escape(value) + ((expire == null) ? "; expires="+  expires : ("; expires=" + expire.toGMTString()))+"; path=/";
}


// Center Pop Window
// <a href="javascript:popWin('page.aspx','sweepstakes','700','500','scrollbars=yes,resizable=yes,status=yes,toolbar=yes');">Link</a>
function popWin(theURL, winName, popW, popH, features) { 
var winleft = (screen.width - popW) / 2;
var winUp = (screen.height - popH) / 2;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',resizable=yes,status=yes,'+features;
Win = window.open(theURL,winName,winProp);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}


function popupWindow(WindowName, URL) { 
var width = 450; 
var height = 406; 
Win = window.open(URL,WindowName,'menubar=no,toolbar=no,status=no,width='+width+',height='+height+',resizable=yes,scrollbars=no'); 
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
} 

function popupCustom(URL, WindowName, width, height, scrolls) { 
CustWin = window.open(URL,WindowName,'menubar=no,toolbar=no,status=no,width='+width+',height='+height+',resizable=yes,scrollbars='+scrolls); 
if (parseInt(navigator.appVersion) >= 4) { CustWin.focus(); }
} 

function winOpenDim(theURL) {
var winleft = (screen.width - 770) / 2;
var winUp = (screen.height - 500) / 2;
Win = window.open(theURL,'dimensions','scrollbars=yes,resizable=yes,status=yes,width=575,height=500,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenRequest(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'info','scrollbars=yes,resizable=yes,status=yes,width=500,height=500,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenMap(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'map','scrollbars=yes,resizable=yes,status=yes,menubar=yes,width=655,height=450,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function popupMovie(theURL){ 
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'movies','scrollbars=no,resizable=yes,status=no,width=265,height=185,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function popupMovie2(theURL){ 
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'movies','scrollbars=no,resizable=yes,status=no,width=415,height=285,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function popupMovie3(theURL){ 
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'movies','scrollbars=no,resizable=yes,status=no,width=265,height=210,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenInfo(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open(theURL,'info','scrollbars=yes,resizable=yes,status=yes,width=400,height=400,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenSlide(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open('/slideshow/'+theURL,'slides','scrollbars=yes,resizable=yes,status=yes,width=400,height=400,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenVirtual(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 500) / 2;
Win = window.open(theURL,'virtual','scrollbars=no,resizable=yes,status=yes,width=730,height=430,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

// Center Golf Window
function golfWin() { 
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
winProp = 'width=795,height=460,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=no,toolbar=yes,status=yes';
Win = window.open('http://book.golfswitch.com/webpro/search.asp?CUSTID=WGU&amp;STATE=NV&amp;REF=http://www.luxor.com','golf',winProp);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function goBackWindow(myUrl) {
        self.opener.window.parent.location = myUrl;
        window.close();
}

function reservations() {
        window.open("/res/resnet.aspx?luxor=sitedefmap");
}

function winInfo(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 500) / 2;
Win = window.open(theURL,'info','scrollbars=yes,resizable=yes,status=yes,width=400,height=430,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function winOpenWinners(url){
contentWin = window.open(url,"winners","resizable=yes,toolbar=no,location=no,width=640,height=420,directories=no,status=no,scroll=auto,scrollbars=yes,menubar=no,left=10,top=10");
window.close();
}

function Ra(){
contentWin =
window.open("/entertainment/ra/index.aspx","Ra","resizable=yes,toolbar=no,location=no,width=610,height=470,directories=no,status=no,scroll=auto,scrollbars=yes,menubar=no,left=10,top=10");
}

function winOpenBMG(url){
contentWin = window.open(url,"BMG","resizable=yes,toolbar=no,location=no,width=607,height=400,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,left=10,top=10");
}

function winOpenRa(){
contentWin = window.open("http://www.ralv.com","Ra","resizable=yes,toolbar=yes,location=yes,directories=yes,status=yes,scroll=auto,scrollbars=yes,menubar=yes,left=10,top=10");
contentWin.focus ();
}

function flashPromotion() {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
Win = window.open('http://www.luxor.com/res/resnet.aspx?offerName=pugt2&sourceCode=zz','promotion','toolbar=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,width=800,height=600,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function flashPromotionSub() {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
Win = window.open('http://www.luxor.com/res/resnet.aspx?offerName=pugt2&sourceCode=zz','promotion','toolbar=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,width=800,height=600,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function flashPromotion3() {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
Win = window.open('/popup/affect_pop/affect_pop.php','promotion','resizable=yes,status=yes,width=520,height=350,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function flashPromotion3(){
	var url = '/popup/affect_pop/affect_pop.php';
	var rateSpecial = window.open(url,'specialdeals','resizable=yes,toolbar=no,location=no,width=520,height=350,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,left=10,top=10');
	rateSpecial.focus();
}

function FlashAccommodations() {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
Win = window.open('https://secure02.mgm-mirage.com/ezbook/index.aspx?prop=lhc&luxor=sitedefaccom','promotion','toolbar=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,width=800,height=600,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

// Center Ecards Window
function ecardsWin(theURL) {
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
Win = window.open('https://secure02.mgm-mirage.com/ecards/'+theURL,'ecards','toolbar=yes,scrollbars=yes,resizable=yes,status=yes,width=795,height=460,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

// RESERVATIONS GUI
function goToRes(){
	var sURL = ""
	var sFeatures
	var sArriveDate
	var iArriveMilli
	var sBAD
	var sBAM
	var sBAY
	var sDepartDate
	var iDepartMilli
	var sBDD
	var sBDM
	var sBDY
	var iNumNights
	var iDayToMilli = 86400000;
	var sDAY
	var sMONTH
	var sYEAR
	
	
	iIndex = document.all("BAD").selectedIndex;
	sBAD = document.all("BAD").options[iIndex].value;
	
	iIndex = document.all("BAM").selectedIndex;
	sBAM = parseInt(document.all("BAM").options[iIndex].value,10);
	
	iIndex = document.all("BAY").selectedIndex;
	sBAY = document.all("BAY").options[iIndex].value;
	
	if (isValidDate(sBAM + "/" + sBAD + "/" + sBAY) == true){
			sArriveDate = new Date(sBAY, sBAM -1, sBAD);
			
	var oTODAY = new Date();
	 sDAY = oTODAY.getDate();
	 sMONTH = oTODAY.getMonth();
	 sYEAR = oTODAY.getYear();
	 
	 if ((sBAY < sYEAR) || (sBAY == sYEAR && sBAM - 1 < sMONTH) || (sBAY == sYEAR && sBAM -1 == sMONTH && sDAY - 1 >= sBAD)){
	 	alert(" Please select a arrival date greater than today.")
	 } 

	 else {	 
			
		iIndex = document.all("nights").selectedIndex;
		iNumNights = parseInt(document.all("nights").options[iIndex].value,10);
	
		iArriveMilli = parseInt(sArriveDate.valueOf(),10);
		iDepartMilli = iArriveMilli + iNumNights*iDayToMilli;
	
		sDepartDate = new Date(iDepartMilli);
		
		sBDD = sDepartDate.getDate();
		sBDM = sDepartDate.getMonth() + 1;
		sBDY = sDepartDate.getFullYear();
		sURL = escape("prop=bay&arrivaldateForm=" + sBAY + "-" + sBAM + "-" + sBAD  + "&numnightsForm=" + iNumNights);
		sURL = "https://secure02.mgm-mirage.com/ezbook/index_flash.aspx?qs=" + sURL;
		sFeatures = "status=yes,width=795,height=560,resizable=yes,scrollbars=yes,top=0,left=0";

		if (sURL.length != 0){
			window.open(sURL, "reservation", sFeatures);
		}
		}
		}
	else{
		alert("Invalid arrival Date");
	}
}

function isValidDate(sDate){
	var arrDate;
	var iMonth;
	var iDay;
	var iYear;
	var bError = false;
			
	arrDate = sDate.split("/");
	if (arrDate.length != 3){
		bError = true;
		}
	else{
		iMonth = parseInt(arrDate[0],10);
		iDay = parseInt(arrDate[1],10);
		iYear = parseInt(arrDate[2],10);
			
		if (isNaN(iMonth) == true ){
			bError = true;
			}
		else{
			if (!(iMonth > 0 && iMonth < 13)){
				bError = true;
			}
		}
			
		if (isNaN(iDay) == true ){
			bError = true;
		}
					
		if (isNaN(iYear) == true ){
			bError = true;
			}
		else{
			if (!(iYear >= 2000 && iYear < 2100)){
				bError = true;
			}
		}
		
		if (!bError){
			if (iMonth == 1 || iMonth == 3 || iMonth == 5 || iMonth == 7 || iMonth == 8 || iMonth == 10 || iMonth == 12){
				if (!(iDay > 0 && iDay < 32)){
					bError = true;
				}
			}
			
			if (iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11){
				if (!(iDay > 0 && iDay < 31)){
					bError = true;
				}
			}
			
			if (iMonth == 2){
				var iMod = iYear % 4;
				if (iMod == 0){
					if (!(iDay > 0 && iDay < 30)){
						bError = true;
					}
					}
				else{
					if (!(iDay > 0 && iDay < 29)){
						bError = true;
					}
				}
			}
				
		}
	}
		
	return(!bError);
		
}



