	//***************************************************/
//********** RESERVATION ****************************/

// -- Calendar
window.addEvent('domready', function() { 
	// english
	myCal5 = new Calendar({ date1: 'n/j/Y'}, {classes: ['bookgui'], direction: 1, tweak: {x: -155, y: -1} });
});

// - Nights
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";};
}
//

// - Resort
function changeResort(txtResort, field, show, hide){
	var myTextBox2;
	myTextBox2 = document.getElementById(field);
	myTextBox2.value = txtResort;
	document.getElementById(hide).style.display = "none";
	if (show != ''){document.getElementById(show).style.display= "block";};
}

function showResort(element,hide){
document.getElementById(element).style.display="block";
//if (hide != ''){document.getElementById(hide).style.display="none";};
}
//

function datePickWin(theURL,ad,nights) { 
if (theURL == '') { theURL = '#'; }
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(); }
}

// Book Gui
function BookGui(ad,nights,prop) { 

var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
var theURL = "https://reservations.mgmmirage.com/bookingengine.aspx";
if (prop!=undefined){
	switch(prop){
	case "Aria Resort & Casino":
	theURL = theURL + "?pid=930";
	break;
	case "Vdara Condo Hotel":
		theURL = theURL + "?pid=938";
		break;

	default:
	theURL = theURL + "?pid=930";
	}
}
if (ad!=undefined){ theURL = theURL + "&ad=" + ad;}
if (nights!=undefined){theURL = theURL + "&nights=" + nights;}
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(); }
}
