function openWindow(url, name, rs, w, h){
	var resize = "";
	 if (rs){
	 resize = "resizable,";
	 }
	popupWin = window.open(url, name, 'scrollbars,' + resize + 'width=' + w + ',height=' + h);
	window.name = 'opener';
	}
	function lpad(n, len, ch) {
		var s = new String(n);
		while (s.length < len) s = ch + s;
		return s;
	}
	function checkTravelYear(vYear) {
		var intYear = parseInt("0" + String(vYear),10);
		if(intYear < 100) {intYear += 2000;}
		return(intYear);
	}
	function postTo(productForm, baseURL) {

		var oForm = document.getElementById(productForm);
		var promoInternalRefId = oForm["PROMO_INTERNAL_REF_ID"].value;
		var promoInternalRefClickId = oForm["PROMO_INTERNAL_REF_CLICK_ID"].value;

		var actionBase = "/vacations/lang/en-us/vacations_ver.asp";

		var _cal = "";
		
		if(productForm == "QuickPickUSVacationsSearchacc"){
			_cal = "2";
		}
		
		var strDate = new String(oForm["vacation_date_departure_CTL" + _cal].value);

			var arrDate = strDate.split("/");
			oForm["DepartureMonth"].value = (lpad(String(arrDate[0]),1,"0")-1);
			oForm["DepartureDay"].value = String(arrDate[1]);
			oForm["DepartureYear"].value = String(checkTravelYear(arrDate[2]));
			var strDate = new String(oForm["vacation_date_return_CTL" + _cal].value);

			var arrDate = strDate.split("/");
			oForm["ReturnMonth"].value = (lpad(String(arrDate[0]),1,"0")-1);
			oForm["ReturnDay"].value = String(arrDate[1]);
			oForm["ReturnYear"].value = String(checkTravelYear(arrDate[2]));


		if(oForm["Navigation/Vacations/@Add_RC"].value == "h"){
			var propid = "propid=" + oForm["Navigation/Vacations/Featured_Hotel/ID"].value;
			var productid = "&productid=5R";
			var CheckOutDate = "&CheckOutDate=" + new String(oForm["vacation_date_return_CTL" + _cal].value);
			var CheckInDate = "&CheckInDate=" + new String(oForm["vacation_date_departure_CTL" + _cal].value);
			var numberOfRooms = "&numberOfRooms=" + new String(oForm["Navigation/Vacations/Rooms_count"].value);
			
			if(oForm["Navigation/Vacations/Featured_Hotel/ID"].value=="MGM"){
				window.location.href = "/qp.asp?city=LAS" + productid + CheckOutDate + CheckInDate + numberOfRooms;
			}else{
				window.location.href = "/qp.asp?" + propid + productid + CheckOutDate + CheckInDate + numberOfRooms;
			}
					
		}else{
		
			oForm.action = actionBase + "?irefid=" + promoInternalRefId + "&irefclickid=" + promoInternalRefClickId;
			oForm.submit();
		}

	}
	
	function hotelsearch(id){
		var oForm = document.getElementById("QuickPickUSVacationsSearchacc");

		oForm["Navigation/Vacations/Featured_Hotel/ID"].value = id;
		
		document.getElementById("map").style.display = "none";
		document.getElementById("mapsearch").style.display = "block";
		
	}
	
	function closeForm(){
			document.getElementById("map").style.display = "block";
		document.getElementById("mapsearch").style.display = "none";
	}
	
	function updateSearch(arg){
		if(arg=="hotel"){
			document.getElementById("hotelflight").style.display = "none";	
			document.getElementById("dfrom").style.display = "none";	
		}else{
			document.getElementById("hotelflight").style.display = "block";	
			document.getElementById("dfrom").style.display = "block";	
		}
	}
		
		
	function pSearchUpdate(formName, arg){
		var oForm = document.getElementById(formName);
		oForm["Navigation/Vacations/@Add_RC"].value = arg;
		
		if(arg=="h"){
			document.getElementById(formName + "travellers").style.display = "none";
			document.getElementById(formName + "dfrom").style.display = "none";
			document.getElementById(formName + "d1").innerHTML = "check-in";
			document.getElementById(formName + "d2").innerHTML = "check-out";
		}
		else{
			document.getElementById(formName + "travellers").style.display = "block";
			document.getElementById(formName + "dfrom").style.display = "block";
			document.getElementById(formName + "d1").innerHTML = "departing";
			document.getElementById(formName + "d2").innerHTML = "returning";
		}
	}
	
	var selected_hotel="bellagio";
var seleced_image="map-bellagio-";

function HideContent(d) {
	document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
	document.getElementById(d).style.display = "block";
}

function ReverseDisplay(d, i) {
	document.getElementById(selected_hotel).style.display = "none";
	if(document.getElementById(d).style.display == "none") { 
		document.getElementById(d).style.display = "block"; 
	} else { 
		document.getElementById(d).style.display = "none"; 
	}
	

	document.getElementById("link-" + d).className = "map-nav_current";
	document.getElementById("link-" + selected_hotel).className = "";
	
	document.getElementById(seleced_image).src = "images/" + seleced_image + "off.gif";
	document.getElementById(i).src = "images/" + i + "on.gif";

	selected_hotel = d;
	seleced_image = i;
	
	 closeForm();

}
