var loadcheck;
loadcheck=0;


var address  ="/hotels/taj/images";
var laddress ="/hotels/taj/";
var faddress ="www.tajhotels.com";
var domain_name="www.tajhotels.com"
var httpsaddress="https://www.tajhotels.com"


//The checkbox should always be named as chkRoomType
function checkcheck(f)
{
/*
	if(f.chkRoomType)
	{		
		for (i=0;i<f.chkRoomType.length;i++)
		{
			if(f.chkRoomType[i].checked==true)
			{
				val = true;
				break; 
			}
			else
			{
			val = false;
			}
		}
		if (val==false)
		{
			alert("Please select at least one Room Type to proceed")
		}
	}
	else
	{
	val = false;

	}
	return val;
*/
return true
}


function emailthispage()
{
tryEmail = window.open("../../mailthispage/default.asp","Email","width=550,height=500,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}

function callPop(e,f)
{
//alert (e.name);
//if(window.)
//{
	//alert ("Daey ! Bongu!");
	
//}
var checkOpen;
checkOpen=0;
//alert (tryWin)
tryWin="";
if (tryWin != null)
{
	//alert (tryWin)
}

tryWin = window.open("about:blank","",'location=no,toolbar=no,status=no,menubar=no,resizable=no,titlebar=no,width=300,height=150,top=300,left=390')
	with (tryWin.document)
	{
	writeln ("<html><head><title>"+f+"</title>")
	writeln ("<scr"+"ipt>")
	writeln ("function resizerepos()")
	writeln ("{")
	writeln ("w = document.tryImg.width+9")
	writeln ("h = document.tryImg.height+29")
	writeln ("window.resizeTo (w,h)")
	writeln ("tryWidth = window.screen.width/2")
	writeln ("tryWidth2 = document.tryImg.width/2")
	writeln ("tryHeight = window.screen.height/2")
	writeln ("tryHeight2 = document.tryImg.height/2")
	writeln ("trySet1 = tryWidth-tryWidth2")
	writeln ("trySet2 = tryHeight-tryHeight2")
	writeln ("if (trySet1<0){trySet1=0}")
	writeln ("if (trySet2<0){trySet2=0}")
	writeln ("window.moveTo(trySet1,trySet2)")
	writeln ("}")
	writeln ("//send()")
	writeln ("</scr"+"ipt>")
	writeln ("</head><body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>")
	writeln ("<img src='"+laddress+"/PressRoom/PhotoLibrary/Images/"+e+"' name=tryImg border=0 bordercolor=#000000 align=center onLoad='javascript:resizerepos();'>")
	//writeln ("<P>Trying Auto Pop</P>")
	writeln ("<scri"+"pt>")
	writeln ("//resizerepos()")
	writeln ("</scri"+"pt>")
	writeln ("</body></html>")
	}
}


function send()
{

 
//alert (FlashEnabled);
w = document.tajmap.width;// + 20;
h = document.tajmap.height; // + 20;
incW= parseInt(w) + 10;
incH= parseInt(h);
window.resizeTo (incW,incH+87)
//alert(incH);
tryWidth = window.screen.width/2
tryWidth2 = document.tajmap.width/2;
tryHeight = window.screen.height/2
tryHeight2 = document.tajmap.height/2;
trySet1 = tryWidth-tryWidth2
trySet2 = tryHeight-tryHeight2
 
if (trySet1<0)
	{
	alert ("Too Big!")
	trySet1=0
	}
	if(navigator.userAgent.indexOf("Opera")!=-1)
	{
	window.moveTo(300,100);
	}
	else
	{
		
	window.moveTo(trySet1,trySet2)
	}
}

function send2()
{
w = document.worldmap.width;// + 20;
h = document.worldmap.height;// + 20;
incW= parseInt(w) + 10;
incH= parseInt(h) //+ 65;
window.resizeTo (incW+10,incH+30)
tryWidth = window.screen.width/2
tryWidth2 = document.worldmap.width/2;
tryHeight = window.screen.height/2
tryHeight2 = document.worldmap.height/2;
trySet1 = tryWidth-tryWidth2
trySet2 = tryHeight-tryHeight2
if (trySet1<0)
	{
	alert ("Too Big!")
	trySet1=0
	}
	if(navigator.userAgent.indexOf("Opera")!=-1)
	{
	window.moveTo(300,100);
	}
	else
	{
	window.moveTo(trySet1,trySet2)
    }
}

function getCityMap()
{
	
	var mapWin = window.open("Map.html","mapper","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=410,height=430,top=70");
	
}

function MM_openwin(MM_file,MM_height,MM_width,left,top)
      {
        MM_config=""
		MM_config+="toolbar=no,";
		MM_config+="location=no,"
		MM_config+="directories=no,";
		MM_config+="status=no,"
		MM_config+="menubar=no," //Not on Apple Mac for obvious reasons
		MM_config+="scrollbars=yes,"
		MM_config+="resizable=no," //Mac windows are always resizable
		MM_config+="copyhistory=no,"
		MM_config+="width="+MM_width+","
		MM_config+="left="+left+","
		MM_config+="top="+top+","
		MM_config+="height="+MM_height
		//alert("show");
		var MM_win=open(MM_file,"",MM_config);
		MM_win.focus();
      }
      
function getCityMap1()
{
	var mapWin = window.open("Map1.html","mapper","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=410,height=420");
}
function openHotel(v_hlink)
{
	var hlink= new String(v_hlink);  
    	var StoRep=new RegExp(',');  
	for(i=0;i<2;i++)
	{
	 hlink=hlink.replace(StoRep,'%2C');
	}
	v_hlink=hlink;
	var pos=v_hlink.indexOf("thegatewayhotels.com");
	var vpos=v_hlink.indexOf("vivantabytaj.com");
	if (pos > 0 || vpos > 0)
	{
	window.opener.location.href=v_hlink;
	}
	else
	{
	window.opener.location.href=laddress+v_hlink;
	}
}
function openHotel_ny(v_hlink)
{
	
		var hlink= new String(v_hlink);  
    	var StoRep=new RegExp(',');  
	for(i=0;i<2;i++)
	{
	 hlink=hlink.replace(StoRep,'%2C');
	}
	v_hlink=hlink;
	window.opener.location.href=laddress+v_hlink;
	
	
	//var hlink= new String(v_hlink);  
   // 	var StoRep=new RegExp(',');  
	//for(i=0;i<2;i++)
	//{
	// hlink=hlink.replace(StoRep,'%2C');
	//}
	//v_hlink=hlink;
	//window.opener.location.href=laddress+v_hlink;
	//window.open("../../Luxury/The%20Pierre,New%20York/popup.htm","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=850,height=500,top=10,left=70");
}
//function getMap()
//{
	//alert("Opening Map");
	//mapWin = window.open("Map.html","_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=410,height=420,top=190,left=290");
//}
function returnCurrencyType()
{
             if (document.cookie.indexOf("isIndia=")==-1)
	{
                   //cookie does not exists
	     curr = "USD"
	}
             else
	{
	     //cookie exists
                  idx = document.cookie.indexOf("isIndia=")
                  startIdx = document.cookie.indexOf("=", idx) + 1
                  endIdx = document.cookie.indexOf(";", idx);
	     var isIndia = document.cookie.substring(startIdx, endIdx);
                  if (isIndia ==1)
                   curr = "INR";
	    else
	     curr = "USD"
	}
	return curr;
}

function callme()
{
window.open('https://www.surveymonkey.com/s.aspx?sm=kg3AeB6s4rNrv45t2avOBw%3d%3d','win', 'height=600,width=600,scrollbars=yes,resizable=yes,status=yes')
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function attach()
{
	if(readCookie('surveycookie')==null)
	{
	//alert('Page end');
	//document.write("<scr" + "ipt type='text/javascript'>alert('123')" );
	//document.write("var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');");
	//document.write("document.write(unescape('%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	//document.write("</scr" + "ipt>");
	//createCookie('surveycookie','yes',365);
	//document.write("<scri" + "pt src='https://www.surveymonkey.com/jsPop.aspx?sm=kg3AeB6s4rNrv45t2avOBw_3d_3d'>" + "</scr" + "ipt>");
	//AttachEvent(window,'beforeunload',attach,false);
	//window.onbeforeunload = callme;
	}
}





//Code for Google Tracking
/*document.write("<scr" + "ipt type='text/javascript'>" );
document.write("var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');");
document.write("document.write(unescape('%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
document.write("</scr" + "ipt>");
document.write("<scr" + "ipt type='text/javascript'>" );
document.write("var pageTracker = _gat._getTracker('UA-3757822-1');");
document.write("pageTracker._initData();");
document.write("pageTracker._trackPageview();");
document.write("</scr" + "ipt>");*/
function disableEnterKey()
{
if (window.event.keyCode == 13)
{
    event.returnValue=false;
    event.cancel = true;
    //alert("diaabled");
}
}
function enableEnterKey()
{
if (window.event.keyCode == 13)
{
//alert("active");
    event.returnValue=true;
    //event.cancel = true;
    event.cancelBubble = true;
}
}
