// JavaScript Document
function changeLoc(page)
{
	location.href=page+".html";
	return true;	
}
function changeLocWithout(page)
{
	location.href=page;
	return true;	
}
function savePageAsPDF() {
   var pURL = "http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=" + escape(document.location.href);
  window.open(pURL, "PDFOnline", "scrollbars=yes, resizable=yes,width=640, height=480,menubar,toolbar,location");

}
function printPage() {
	window.print();
}
var newwindow;
function openpopup(url,name, height, width, scroll)
{
	newwindow=window.open(url,name,'height='+height+',width='+width+', scrollbars='+scroll+', location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	if (window.focus) {newwindow.focus()}
}
function openpopupfeedback(url,name, height, width, scroll)
{
	newwindow=window.open(url,name,'height='+height+',width='+width+', left=150, top=20, scrollbars='+scroll+', location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	if (window.focus) {newwindow.focus()}
}
function openpopupMYGreen(url,name, height, width, scroll)
{
	newwindow=window.open(url,name,'height='+height+',width='+width+', left=150, top=20, scrollbars='+scroll+', location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes');
	if (window.focus) {newwindow.focus()}
}
function openpopuphere(url,name,h,w,scrollbar)
{
	newwindow=window.open(url,name,'height='+h+',width='+w+', scrollbars=yes, location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	if (window.focus) {newwindow.focus()}
}
function openpopup2(url)
{
	newwindow=window.open(url,'name','height=500,width=600, scrollbars=false, location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	if (window.focus) {newwindow.focus()}
}
function showDiv(id)
{	
	if(id=="far"){
	hideDiv('login');
	}
	else if(id=="login"){
		hideDiv('far');
		
		}
		else{
			}
			
		document.getElementById(id).style.visibility="visible";
		document.getElementById(id).style.display="block";
	}
function hideDiv(hid){
	document.getElementById(hid).style.visibility="hidden";
		document.getElementById(hid).style.display="none";
	}
	function newWindowweather(a,b)
{
	popupWindow = window.open('http://203.92.40.236/ITCWeather/WeatherPopup.asp?city='+a+'&template='+b,'popUpWindow','height=633,width=446,left=50,top=30,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no, status=yes');
	
}
function windowWeatherNew(hotelid)
{
	//popupWindow = window.open('http://203.92.40.236/itc/itcweather/'+value,'popUpWindow','height=440,width=650,left=50,top=30,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no, status=yes');

	var filename=''
	if (hotelid==309)
		{
			filename='newdelhiweather.html'
		}
	if (hotelid==318)
		{
			filename='newdelhiweather.html'
		}
	if (hotelid==378)
		{
			filename='mumbaiweather.html'
		}
	if (hotelid==306)
		{
			filename='mumbaiweather.html'
		}
	if (hotelid==319)
		{
			filename='bengaloreweather.html'
		}
	if (hotelid==358)
		{
			filename='kolkataweather.html'
		}
	if (hotelid==308)
		{
			filename='hyderabadweather.html'
		}
	if (hotelid==310)
		{
			filename='agraweather.html'
		}
	if (hotelid==313)
		{
			filename='jaipurweather.html'
		}
	if (hotelid==304)
		{
			filename='chennaiweather.html'
		}
	if (hotelid==311)
		{
			filename='chennaiweather.html'
		}
	if (hotelid==314)
		{
			filename='aurangabadweather.html'
		}
	if (hotelid==317)
		{
			filename='barodaweather.html'
		}
	if (hotelid==305)
		{
			filename='vishakhapatnamweather.html'
		}
	if (hotelid==409)
		{
			filename='bengaloreweather.html'
		}
	popupWindow = window.open('http://itchotels.envigo.co.uk/itcweather/'+filename,'popUpWindow','height=440,width=650,left=50,top=30,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no, status=yes');
	
}
var IE = document.all?true:false;
var tempUrl,tempX,tempY;
function closeDiv(){
		document.getElementById("checkMyAv").style.visibility="hidden";
		document.getElementById("checkMyAv").style.display="none";
		document.getElementById('shadedDiv').style.visiblity="hidden";
		document.getElementById('shadedDiv').style.display="none";
	}
	function openDiv(url){
		// Detect if the browser is IE or not.
		// If it is not IE, we assume that the browser is NS.
	document.getElementById("checkMyAv").style.left=0+'px';
	document.getElementById("checkMyAv").style.top=0+'px';		
document.getElementById('shadedDiv').style.visibility="visible";
document.getElementById('shadedDiv').style.display="block";
		// Main function to retrieve mouse x-y pos.s
		document.onclick = getMouseXY;
		tempUrl = url;
		//alert(tempY+' Y:x '+tempX);
		
	}
	
	function getMouseXY(e) {

		// If NS -- that is, !IE -- then set up for mouse capture
		if (!IE) document.captureEvents(Event.MOUSECLICK)
		
		// Set-up to use getMouseXY function onMouseMove
		//document.onclick = getMouseXY;
		
		// Temporary variables to hold mouse x-y pos.s

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
}  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
 		document.getElementById("checkMyAv").style.left=(tempX-400)+'px';
		document.getElementById("checkMyAv").style.top=(tempY-75)+'px';	
		document.getElementById("checkMyAv").style.visibility="visible";
		document.getElementById("checkMyAv").style.display="block";
		document.onclick ="";
  return true
}
function checksign(image)
{
	//alert(image.src);
	if(image.src.indexOf('images/plus.jpg')>1)
	{
		image.src='images/minus.jpg';
		image.alt="Collapse";
		newsLetter('divOpen');
	}
	else if(image.src.indexOf('images/minus.jpg')>1)
	{
		image.src='images/plus.jpg';
		image.alt="Expand";
		newsLetter('divClose');
	}
	else if(image.src.indexOf('images/close.png')>1)
	{
		plus.src='images/plus.jpg';
		plus.alt="Expand";
	}
}
function newsLetter(cont)
{
	document.getElementById('divClose').style.display='block';
	document.getElementById('divOpen').style.display='none';
	document.getElementById(cont).style.display='block';
}
function  setbtn()
{
	obj=document.getElementById('chkbx');
	if(obj.checked)
	{
		alert('You have confirmed this booking to be cancelled.');
	}
	else
	{
		alert('Please confirm that you want to cancel this booking.');
	}
}
function f_trim(strVal){while ( strVal.substring(0,1) == ' ' ) strVal = strVal.substring(1, strVal.length);	while ( strVal.substring(strVal.length - 1, strVal.length) == ' ' )strVal = strVal.substring(0, strVal.length - 1);	return (strVal);}

// NEW - Added on 18-Nov-2009

function showMap(){
document.getElementById('bigmap').style.display = 'block';
document.getElementById('bigmap').style.visibility = 'visible';
}
function closeMap(){
document.getElementById('bigmap').style.display = 'none';
document.getElementById('bigmap').style.visibility = 'hidden';
}
function showLogin()
{
document.onclick = checkClick;

}
function closeLogin()
{
	document.getElementById('loginFrm').style.display = 'none';
	document.getElementById('loginFrm').style.visibility = 'hidden';
	return false;
}
function checkClick(e)
{
        // If NS -- that is, !IE -- then set up for mouse capture
        if (!IE) document.captureEvents(Event.MOUSECLICK)
        
        // Set-up to use getMouseXY function onMouseMove
        //document.onclick = getMouseXY;
        
        // Temporary variables to hold mouse x-y pos.s
      if (IE) { // grab the x-y pos.s if browser is IE
        
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.documentElement.scrollTop
      } 
     else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }  
  // catch possible negative values in NS4
      if (tempX < 0){tempX = 0}
      if (tempY < 0){tempY = 0}  
      
        document.getElementById('loginFrm').style.top = tempY-300+"px";
        document.getElementById('loginFrm').style.left = tempX+"px";
        document.getElementById('loginFrm').style.visibility = 'visible';
        document.getElementById('loginFrm').style.display = 'block';
        document.onclick = '';
        
        return false;
 }