
function specialBook(id) {
window.open("https://www.totalhospitality.net/scripts/mgwms32.dll?MGWLPN=PROSHARED&wlapp=CRO&FIT=" + id + "&window=open","_blank","height=600,width=700,scrollbars=yes,menubar=no,toolbar=no,resize=yes");
}


function makeBook(id) {
window.open("https://www.totalhospitality.net/scripts/mgwms32.dll?MGWLPN=PROSHARED&wlapp=CRO&FIT=" + id + "&window=open","_blank","height=600,width=700,scrollbars=yes,menubar=no,toolbar=no,resize=yes");

}

 
 function windowOpen(page, title, attributes) {
	window.open(page, title, attributes);
 }
 
 function windowClose() {
	window.close();
 }
 
function userDateSelect(form, control, year, month, day) {
	var form = window.opener.document['frm_calendar'];
	var dayList = control + "_day";
	var monthList = control + "_month";
	var yearList = control + "_year";
	
	for (i =0 ; i < form.elements[dayList].options.length; i++) {
		if (form.elements[dayList].options[i].value == day) {
			form.elements[dayList].selectedIndex = i;
		}
	}
	for (i =0 ; i < form.elements[monthList].options.length; i++) {
		if (form.elements[monthList].options[i].value == month) {
			form.elements[monthList].selectedIndex = i;
		}
	}
	for (i =0 ; i < form.elements[yearList].options.length; i++) {
		if (form.elements[yearList].options[i].value == year) {
			form.elements[yearList].selectedIndex = i;
		}
	}
}

  
function outpostCloseLayer(layer) { var style = document.getElementById(layer).style; style.display = "none";}
function outpostOpenLayer(layer) { var style = document.getElementById(layer).style; style.display = "block";}
function outpostGetLayer(layer) {if (document.layers) return document.layers[layer];else if(document.getElementById) return document.getElementById(layer);else if(document.all) return document.all[layer];}
 
function checkAvailability() {
	var _form = document.step1Form;
	var _form1 = document.frm_calendar;

	_form.propertyID.value = 12;
	_form.locationID.value = 46;

	_form.dateIn_day.value = _form1.frm_start_day.options[_form1.frm_start_day.selectedIndex].value;
	_form.dateIn_month.value =  _form1.frm_start_month.options[_form1.frm_start_month.selectedIndex].value;
	_form.dateIn_year.value =  _form1.frm_start_year.options[_form1.frm_start_year.selectedIndex].value;
	
	_form.dateOut_day.value =  _form1.frm_end_day.options[_form1.frm_end_day.selectedIndex].value;
	_form.dateOut_month.value =  _form1.frm_end_month.options[_form1.frm_end_month.selectedIndex].value;
	_form.dateOut_year.value =  _form1.frm_end_year.options[_form1.frm_end_year.selectedIndex].value;
	
	_form.submit();
} 
 
 
function outpostToggleLayer( whichLayer ) {
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

var g_layer = ""; 
function showWPLayer(layer) {
	if (g_layer != "") outpostToggleLayer( g_layer );
	outpostToggleLayer( layer );
	g_layer = layer;
} 
 
 
function ajaxShowImage(layer, image) {
	var file = "";
	switch (image) {
		case "gallery_preview01.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img08A.jpg";
			break;
		case "gallery_preview01.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img08A.jpg";
			break;
		case "gallery_preview02.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img07A.jpg";
			break;
		case "gallery_preview03.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img04A.jpg";
			break;
		case "gallery_preview04.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img01A.jpg";
			break;
		case "gallery_preview05.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img02A.jpg";
			break;
		case "gallery_preview06.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img03A.jpg";
			break;
		case "gallery_preview07.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img05A.jpg";
			break;
		case "gallery_preview10.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img10A.jpg";
			break;
		case "gallery_preview11.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img11A.jpg";
			break;
		case "gallery_preview12.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img12.jpg";
			break;
		case "gallery_preview13.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img13.jpg";
			break;
		case "gallery_preview14.gif":
			file = sys_site + "users/Image/BayPlaza/Graphic/flash_img14.jpg";
			break;
	}

	var _layer = outpostGetLayer(layer);
	_layer.innerHTML = "<img src='" + file + "' border='0'>";
}
