function UpperCase(obj){
var str=obj.value;
obj.value=str.toUpperCase();}
function ConfirmCancel(){
if (confirm("Your current transaction will be cancelled. Continue ?")) 
return true;
else
return false;}
function loadpic(td_num,img){
if(img=='flights-sel')
img="flighttab1.gif"
else
img="tab1.gif";
document.getElementById(td_num).style.background='url(/Image/'+img+')';
document.getElementById(td_num).className='red size1';}
function loadpicindx(td_num,img){
//alert('Dear customer, we are facing some technical issues on our phone numbers. Kindly contact us on 022-40666444. Inconvenience regretted.');
img="btn_sel " +img +" red";
document.getElementById(td_num).className=img;}
function showRefund(){
window.open('/service/pages/cancelation.htm','terms','toolbar=false,statusbar=false,scrollbar=true,addressbar=false,resize=true,width=800,height=450,left=50,top=150'); }
function showterms() {
window.open('/service/pages/terms.htm','terms','toolbar=false,statusbar=false,scrollbar=true,addressbar=false,resize=true,width=800,height=450,left=50,top=150'); }
function showRefund(){
window.open('/service/pages/refund.htm','refund','toolbar=false,statusbar=false,scrollbar=true,addressbar=false,resize=true,width=800,height=450,left=50,top=150'); }
function showrules(){
window.open('/service/pages/rules.htm','terms','toolbar=false,statusbar=false,scrollbar=true,addressbar=false,resize=true,width=750,height=418,left=50,top=150'); }
function dG(id){
var iid =document.getElementById(id);
return iid;}
function renttype(ss){
if (ss==1){
dG("trP2P").style.display='none';
dG("rw1").style.display='none';
dG("trCity").style.display='';
dG("rw2").style.display='';
}else{
dG("trCity").style.display='none';
dG("rw1").style.display='';
dG("trP2P").style.display='';
dG("rw2").style.display='none';}}
function checkRooms(value){
if (value==1){
dG("room2").style.display='none';
dG("room3").style.display='none';
dG("cmbAdult2").selectedIndex=0;
dG("cmbAdult3").selectedIndex=0;
dG("cmbChild2").selectedIndex=0;
dG("cmbChild3").selectedIndex=0;
}else if (value==2){
dG("room2").style.display='';
dG("room3").style.display='none';
dG("cmbAdult3").selectedIndex=0;
dG("cmbChild3").selectedIndex=0;
}else{
dG("room2").style.display='';
dG("room3").style.display='';}}
function fetchData(url,objectID){
var pageRequest = false; 
if (window.XMLHttpRequest){
pageRequest = new XMLHttpRequest();
}else if (window.ActiveXObject){ 
try {
pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
}catch(e){
try{
pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
}catch (e){}}}
 pageRequest.onreadystatechange = function() {
 try{
if (pageRequest.readyState > 3) {
var object = document.getElementById(objectID);
object.innerHTML = pageRequest.responseText; 
if(dG('trsuggest')){
if(objectID=='Layer1'){
var posx=findPosX(dG('txtCountry'))
}else{
 var posx=findPosX(dG('txtCity'))}
if(dG('Layer1')){
dG('Layer1').style.display='';
dG('Layer1').style.left=posx+'px';}
if(dG('Layer2')){
dG('Layer2').style.left=posx+'px';
}
dG('iframe1').style.display="";
dG('iframe1').style.left=posx+"px";
dG('iframe1').style.height=(parseInt(dG('Layer1').clientHeight,10)-10)+"px";}
if(dG('trsuggest1')){ 
dG('Layer2').style.display='';
if(objectID=='Layer1'){
var posx=findPosX(dG('txtCountry'))
}else{
var posx=findPosX(dG('txtCity'))}
dG('Layer2').style.left=posx+'px';
dG('iframe1').style.left=posx+"px";
dG('iframe1').style.height=(parseInt(dG('Layer2').clientHeight,10)+10)+"px";}
if(pageRequest.responseText.length <= 0){ 
dG('iframe1').style.display="none";
ifrm2.style.display='none'; 
return false;} 
if(dG('suggest'))
ifrm2=dG('suggest');
if(dG('tblArr')){
ifrm2.style.left=findPosX(document.getElementById(objectID))+2+'px';
var tpp=findPosY(dG('selDeparture'))+ dG('selDeparture').offsetHeight+'px';
ifrm2.style.top= tpp;
dG('divFrom').style.top=tpp;
ifrm2.style.height=(parseInt(dG('tblArr').offsetHeight,10)+10)+'px'; 
ifrm2.style.width=229+'px';
ifrm2.style.display='';} 
if(dG('tblDep')){ 
ifrm2.style.left=findPosX(document.getElementById(objectID))+2+'px';
var tpp=findPosY(dG('selArrival'))+dG('selArrival').offsetHeight+'px';
ifrm2.style.top= tpp;  
dG('divTo').style.top=tpp;
ifrm2.style.height=(parseInt(dG('tblDep').offsetHeight,10)+10)+'px'; 
ifrm2.style.width=229+'px';
ifrm2.style.display='';}}
}catch(err){} }
pageRequest.open('get',url,true);
pageRequest.send(null);}
function findPosX(obj){
var curleft = 0;
if(obj.offsetParent)
while(1) {
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;}
else if(obj.x)
curleft += obj.x;
return curleft;}
function findPosY(obj){
var curtop = 0;
if(obj.offsetParent)
while(1){
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}else if(obj.y)
curtop += obj.y;
return curtop;
}
var cntry=0;
function suggest(Rid,type){
if(type=='country'){cntry=1;}else{cntry=0;}
var count=dG('txtCountry').value;
var city=dG('txtCity').value;
if (type=="country")
dG('txtCity').value="";
fetchData('/HotelReservation/Common/pages/Intsuggest.aspx?Type='+type+'&cnt='+count+'&cty='+city, Rid);
}
function Eli_over(country){
dG('txtCountry').value=country;
}
function Eli_overct(country){
dG('txtCity').value=country;
}
function callclickcntry(val){
if(dG('iframe1'))dG('iframe1').style.display='none';
if(dG('Layer1'))
dG('Layer1').style.display='none';
 dG('txtCountry').value=val;
 dG('trsuggest').style.display='none';
}
function callclickcity(val){
 if(dG('Layer2'))
dG('Layer2').style.display='none';
dG('txtCity').value=val;
dG('trsuggest1').style.display='none';
 }
 function validate(){
 if (dG("txtCity").value=='')
alert('Please Select Destination'); 
 else if (dG("txtFrom4int").value=='')
alert('Please Select Check in Date');
 else if (dG("txtTo4int").value=='')
alert('Please Select Check Out Date')
 else{
fetchData("index.aspx?Product=IntHotel&city="+dG('txtCity').value+"&Country="+dG('txtCountry').value,"")
dG('tdContainer').innerHTML="<span class='white-content'>Please Stand By While WEe Process Your Request<br /><img src='Image/loading/indexLoader.gif' alt='Loading Hotels' /></span>"
setTimeout("scriprRedirectionForIntHotel()",2000);
}
}
function scriprRedirectionForIntHotel(){
window.open("HotelReservation/tc/Pages/IntSearchresult.aspx","_self");
}
function PageQuery(q){
if(q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) 
{
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function(){
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) 
{
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() 
{ return this.keyValuePairs.length; } 
}
function qryString(key){
var page = new PageQuery(window.location.search); 
return unescape(page.getValue(key)); 
}
function QueryString(key){
if(qryString(key)=='false'){
return false;
}else{
return qryString(key);
}
}
function ResetForm(){
document.form1.reset();
}
function height(){
try{
 var viewportheight; 
 if (typeof window.innerWidth != 'undefined'){
viewportheight = window.innerHeight
 }else if (typeof document.documentElement != 'undefined'&& typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0){
viewportheight = document.documentElement.clientHeight
}else{
viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
 dG('tdHeight').style.height=(viewportheight-143)+ "px";
}
catch(err){}
}
function ChangeTravelType(status,ctrlId){
if(status){
if(document.getElementById(ctrlId)!=null){
if(dG('Img1')!=null)
dG('Img1').style.cursor="default";
document.getElementById(ctrlId).disabled=true;
}
}else{
if(document.getElementById(ctrlId)!=null){
if(dG('Img1')!=null)
dG('Img1').style.cursor="pointer";
document.getElementById(ctrlId).disabled=false;
}
}
}
var intval="", intval1="";
var h=5, mht=5, wrk=0;
function show(){
wrk=1;
if(objExpand.style.display='none')objExpand.style.display='';
objExpand.style.height=cht+"px";
if((parseInt(cht,10))<(parseInt(maxHt))){
cht =parseInt(cht);
cht=cht+1;
}else{
objExpand.style.display='';
window.clearInterval(intval);
wrk=0;
}
}
function hide(){
wrk=1;
if((parseInt(cht,10))>(parseInt(mht,10))){
cht =parseInt(cht);
cht=cht-1;
objExpand.style.height=cht+"px";
}else{
objExpand.style.display='none';
window.clearInterval(intval1);
wrk=0;
}
}
var maxH, cht, objExpand;
function expandLogin(hght, obj){
objExpand=obj;
if(wrk==1){return};
maxHt=hght;
objExpand=document.getElementById(obj);
cht=parseInt(objExpand.style.height);
if(objExpand.style.display=='none'){
intval=window.setInterval("show()",10);
}else{
intval1=window.setInterval("hide()",10);
}
}
