﻿//***********************************************/
//* Caravellehotel.com Project                   */
//* (c) 2007 CuteBiz Solutions Corporation      */
//* http://www.cutebiz.com                      */
//* Created by Smart River on 27 Aug. 07        */
//***********************************************/

function switch_display(obj)
{
    reloadable = false;
	obj.style.display = (obj.style.display=='')?'none':'';
	setTimeout('reloadable = true;',500);
}

function switch_display3(obj)
{
    reloadable = false;
	obj.style.display = (obj.style.display=='')?'none':'';
	setTimeout('reloadable = true;',500);
	$('#mycustomscroll').jScrollPane({animateTo:false});
}

function switch_display2(objName)
{
	reloadable = false;
	obj = document.getElementById(objName);
	obj.style.display = (obj.style.display=='')?'none':'';
	setTimeout('reloadable = true;',500);
}

function switch_display4(objName)
{
	reloadable = false;
	obj = document.getElementById(objName);
	obj.style.display = (obj.style.display=='')?'none':'';
	$('#mycustomscroll').jScrollPane({animateTo:false});
}

function goVirtualTour(msg) {
	alert(msg);
}

function goBookNow(msg) {
	alert(msg);
}

/* Java language start */

	/*English*/
	en_goVT = "Virtual tour is not available at the moment, please check it out later!";
	en_goBN = "Please select check-in, check-out date, number of room and person then click on\nthe Check Availability on the left column to start booking.";

/* Java language end */

function openPopup(url,w,h)
{    
  
  var wleft = (screen.width - w) / 2;
  var wtop = (screen.height - h) / 2 - 40;
  
  var win=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+w+",height="+h+",top="+wtop+",left="+wleft);
  /*  
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
  */
}

function OpenMeSize(url, inNew, winDef,h,w)
{
	bsh = 96;
	rsw = 10;
	h = h - bsh;
	w = w - rsw;
	if (url == '')
		return;

	if (typeof(inNew)=='undefined!')
		inNew = 0;

	if (winDef=='default')
		winDef = 'Height='+h+',Width='+w+',Top='.concat((screen.height - h)/2-20).concat(',Left=').concat((screen.width - w)/2); //.concat(',scrollbars,resizable');
		
	if (winDef=='resizable')
		winDef = 'Height='+h+',Width='+w+',Top='.concat((screen.height - h)/2).concat(',Left=').concat((screen.width - w)/2).concat(',resizable');

	if (winDef=='havescroll')
	{
		winDef = 'Height='+h+',Width='+w+',Top='.concat(((screen.height - h)/2) - (bsh/2)).concat(',Left=').concat(((screen.width - w)/2) - (rsw/2)).concat(',scrollbars,resizable,status');
		//winDef = 'Height='+h+',Width='+w+',Top=0,Left=0,scrollbars,resizable,status';
		//alert(winDef);
	}

	if (inNew)
	{
		newWindow = window.open(url, inNew, winDef);
		newWindow.focus();
	}
	else
	{
		location.href = url;
	}
}
