 // gloabl set varibale for back
 
 //backToSeach = backToSeach+1;
    
    function baclToSearchResult(formName,actionName,actionValue,page) { 
      
     eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;			 		 
	 eval("document."+formName).action = actionName; 
	 eval("document."+formName).submit();    
    }
    
	function submitPage(formName,actionName,actionValue,page)
	{ 
	
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;			 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	
	function completerReservation(formName,actionName,actionValue,page)
	{ 
	
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;			 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	function bookingProcess(formName,actionName,actionValue,page)
 	{
  	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page; 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	 }
	function submitEmailCheck(formName,actionName,actionValue,page)
	{ 
	
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".emailCheck").value = page;			 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	function submitFlightEmailCheck(formName,actionName,actionValue,page)
	{ 
	  
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".emailCheck").value = page;
	  eval("document."+formName+".email").value =	document.getElementById("emailId").value;	 	 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	function submitHotelEmailCheck(formName,actionName,actionValue,page)
	{ 
	  
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".emailCheck").value = page;
	  eval("document."+formName+".email").value =	document.getElementById("emailId").value;	 	 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	function submitCarSearch(formName,actionName,actionValue,page)
	{
	 
	 
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	// alert(eval("document."+formName+".same").value);
	// alert(eval("document."+formName).action);
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	}
	function checkPickUp()
	{
	
	 if(document.getElementById("chkPickUp").checked != true) {
	    document.getElementById("chkPickUp").value="n";
	    document.getElementById("dropUpCity").value ="";
	 }
	}
	function submitVacationSearch(formName,actionName,actionValue,page)
	{
	 var newHidden;
	 eval("document."+formName+".actionType").value = actionValue;
	 eval("document."+formName+".thisPage").value = page;
	 document.getElementById("homeForm").action= "http://booking.etripinfo.com/nexres/start-pages/gateway.cgi";
	 newHidden = document.createElement("input"); 
	 newHidden.setAttribute("type","hidden");
	 newHidden.setAttribute("id","action");
	 newHidden.setAttribute("name","action");
	 newHidden.setAttribute("value","search");
	 document.getElementById("homeForm").appendChild(newHidden);
	 
	 if(document.homeForm.leavingFrom.value == "") {
	  document.getElementById("errorMessageId").innerHTML = "From left blank";
	  return ;
	  }else if(document.homeForm.goingTo.value == "") {
	   document.getElementById("errorMessageId").innerHTML = "To left blank";
	  return;
	  }
	 document.getElementById("homeForm").submit();
	}
	function submitHotelSearch(formName,actionName,actionValue,page)
	{
		if(document.getElementById("airportName_ID").value=="") 
		 {
			document.getElementById("airportName_ID").value=document.getElementById("airportName").value;
		}
	  document.getElementById("airportName").value=document.getElementById("airportName_ID").value;
	 // alert(document.getElementById("airportName").value);  
	 // alert(eval("document."+formName+".airportName").value); 
	 eval("document."+formName+".actionType").value = actionValue;	 
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	 displaySearchMessage("","")
	 setTimeout('closeMessage();',100000); 
	}
	
	function submitHotelSortBy(formName,actionName,actionValue,page)
	{
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".sortType").value = "TRUE"
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	 displaySortMessage("","")
	 setTimeout('closeMessage();',100000);  
	}
	
	function submitHotelSortDisplay(strVal)
	{
	 if(strVal == "PRICE") {
	 document.getElementById("sortTypePriceId").style.display="block";
	 document.getElementById("sortTypeStarId").style.display="none";
	 	//document.getElementById("sortTypeId").innerHTML="'>Lowest to Highest Highest to Lowest";
	 } else  if(strVal == "STARS") {
	 document.getElementById("sortTypeStarId").style.display="block";
	 document.getElementById("sortTypePriceId").style.display="none";
	// document.getElementById("sortTypeId").innerHTML="Lowest to Highest Highest to Lowest";
	 }
	}
	function submitHotelSortByType(formName,actionName,actionValue,page,sortTypeValue)
	{
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	  eval("document."+formName+".hotelSortType").value = sortTypeValue;
	 eval("document."+formName+".sortType").value = "TRUE"
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	 displaySortMessage("","")
	 setTimeout('closeMessage();',100000);  
	}
	function submitHotelDetail(formName,actionName,actionValue,page,hotelId,hotelDetailvalue,hotelPrice,hotelAvailable)
	{
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".hotelIds").value = hotelId; 
	 eval("document."+formName+".hotelDetailBy").value = hotelDetailvalue; 
	 eval("document."+formName+".hotelDetailFrom").value = hotelPrice;
	 eval("document."+formName+".hasAvailable").value = hotelAvailable;
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	}
	
	function rateRule(formName,actionName,actionValue,page,hotelId,roomTypeCode,invoiceCode,ratePlanCode,totalrate,totalCharges,checkRateType)
	{
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".hotelIds").value = hotelId; 
	 eval("document."+formName+".roomTypeCode").value = roomTypeCode; 
	 eval("document."+formName+".rateInvoiceCode").value = invoiceCode; 
	 eval("document."+formName+".ratePlanCode").value = ratePlanCode; 
	 eval("document."+formName+".totalRateAmount").value = totalrate; 
	 eval("document."+formName+".totalCharges").value = totalCharges; 
	 eval("document."+formName+".checkRateTypes").value = checkRateType;
	 eval("document."+formName).action = actionName; 
	// alert( eval("document."+formName+".hotelIds").value);
	 eval("document."+formName).submit();  
	}
	
	function submitCruiseSearch(formName,actionName,actionValue,page)
	{
	 //eval("document."+formName+".actionType").value = actionValue;	
	// eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).method="get"; 
	 eval("document."+formName).submit();  
	}
	
	function submitForm(){
    // if called from the cruise search or vacation search
		if(isValidZip(document.homeForm.shoppingZipCode.value))
		{
			hide_inlinemsg('errShowZipMsg');
			return true;
		}
		else
		{
			display_inlinemsg('errShowZipMsg'); 
			return false;
		}				
    }
   
   
   function getAreaBySearch(formName,actionName,actionValue,page)
	{ 
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".areaSearching").value = "TRUE";
	 eval("document."+formName).action = actionName; 
	 eval("document."+formName).submit(); 
	    displaySearchMessage("","")
	 setTimeout('closeMessage();',100000);
	}
	function getLandMarkBySearch(formName,actionName,actionValue,page)
	{
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".landMarkSearching").value = "TRUE";
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	  displaySearchMessage("","")
	 setTimeout('closeMessage();',100000); 
	}
    
	function submitForgotPasswordPage(formName,actionName,actionValue,page,forgotPasswordTypes)
	{ 
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".forgotPasswordType").value = forgotPasswordTypes;			 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}

	function submitLink(formName,actionName,actionValue)
	{
		eval("document."+formName+".actionType").value = actionValue;	 		 
	 	eval("document."+formName).action = actionName;
	 	eval("document."+formName).submit();  
	}

	function getLocationType(locationValue)
	{
	  if(locationValue == "CITY") {
	  
	    document.getElementById("locationCityId").style.display = "block";
		document.getElementById("locationAddressId").style.display 	= "none";
		document.getElementById("locationAirportId").style.display 	= "none";
		document.getElementById("locationAttractionId").style.display 	= "none"; 
		
	  
	  } else if(locationValue == "ADDRESS") {
	    document.getElementById("locationCityId").style.display = "none";
		document.getElementById("locationAddressId").style.display 	= "block";
		document.getElementById("locationAirportId").style.display 	= "none";
		document.getElementById("locationAttractionId").style.display 	= "none";
	  } else if(locationValue == "AIRPORT") {
	   document.getElementById("locationCityId").style.display = "none";
		document.getElementById("locationAddressId").style.display 	= "none";
		document.getElementById("locationAirportId").style.display 	= "block";
		document.getElementById("locationAttractionId").style.display 	= "none";
	  } else if(locationValue == "LANDMARK") {
	    document.getElementById("locationCityId").style.display = "none";
		document.getElementById("locationAddressId").style.display 	= "none";
		document.getElementById("locationAirportId").style.display 	= "none";
		document.getElementById("locationAttractionId").style.display 	= "block";
	  }
	}


	function getMoreSearchOption(type)
	{
	
	 if(type == 1) { 
	 document.getElementById("moreSearchOptionId").style.display 	= "block";
	 document.getElementById("moreSearchOption").value=1;
	 document.getElementById("searchHideId").innerHTML = "<a href='javascript:getMoreSearchOption(2);' class='navlink'>Hide</a>";
	 
	 }else if(type == 2) { 
	 document.getElementById("moreSearchOptionId").style.display 	= "none";  
	 document.getElementById("moreSearchOption").value=0; 
	 document.getElementById("searchHideId").innerHTML = "<a href='javascript:getMoreSearchOption(1);' class='navlink'>Show</a>";
	 }
	 
	}
	
	function sendEmail() 
	{ //alert(document.getElementById('email').value);
	 document.homeForm.action="http://ui.constantcontact.com/d.jsp?ea="+document.getElementById('email').value+"&go=GO&m=1101137190633&p=oi"; 
     document.homeForm.submit(); 
	}
	
	function checkMonth(month)
	{
	
	 if(month > document.getElementById("dropUpMonth").value) { 
		 var pickUpMonths = parseInt(month);
		 
		 var dropUpMonth = "";
		 
		 if(month == "08") {
		 	pickUpMonths = 8;
		 }
		 if(month == "09") {
		 	pickUpMonths = 9;
		 }
		 if(pickUpMonths == 12) {
		 document.getElementById("dropUpMonth").value="12";
		 }
		 else {
			 if(pickUpMonths > 8) {  
			    dropUpMonth = pickUpMonths+1;
			    document.getElementById("dropUpMonth").value=dropUpMonth; 
			    }
			 else {
			 	dropUpMonth = "0"+(pickUpMonths+1);
			 	document.getElementById("dropUpMonth").value=dropUpMonth;
			 }   
		 }
	  }
	  
	}
	
	function checkDate(date)
	{
	if(date > document.getElementById("dropUpDay").value) { 
		var pickUpDate = parseInt(date);
		 var dropUpDate = "";
		 
		 if(date == "08") {
		 	pickUpDate = 8;
		 }
		 if(date == "09") {
		 	pickUpDate = 9;
		 }
		 if(pickUpDate == 31) {
		 document.getElementById("dropUpDay").value="31"; 
		 }
		 else {
			 if(pickUpDate > 8) {  
			    dropUpDate = pickUpDate+1;
			    document.getElementById("dropUpDay").value=dropUpDate; 
			    }
			 else {
			 	dropUpDate = "0"+(pickUpDate+1);
			 	document.getElementById("dropUpDay").value=dropUpDate;
			 }   
		 }
	 }
	}

	
	
	
	
	function isValidZip(vZip){
 		if (parseFloat(vZip)<=0 || isNaN(vZip)  || (vZip.indexOf('.') !== -1) || (trim(vZip).length >= 1 && trim(vZip).length < 5)){
				return false;
		}
		else{
			return true;
		}
}

function ValidEmail(item){
	var invalidchars
	var isAT;
	var isDot;	
	var strTest = item.value;
	var strOutput;
    			
		strOutput = strTest.replace(/ /gi, "");			
		item.value = strOutput;
    			
    		
		invalidchars = " /,;:";
		for (i=0; i<invalidchars.length; i++){
			var badchar = invalidchars.charAt(i);
			if (item.value.indexOf(badchar,0) >= 0){ 
				return false;
			}
		}		
		isAT = item.value.indexOf("@");
		isDOT = item.value.lastIndexOf(".");			
		if (isAT == -1 || isDOT == -1 || item.value.indexOf(" ") != -1 || isAT + 1 >= isDOT){
			return false;
		}			
		if (isDOT + 3 > item.value.length){
		 	return false;
		}		
		return true;
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


// Hotel Search

 function checkState(countryValue)
 {
  if(countryValue == "US") { 
  document.getElementById("cityTypestateValueId").style.display='block'; 
  document.getElementById("cityTypeStateLabelId").innerHTML='State';
  }else {
  document.getElementById("cityTypestateValueId").style.display='none';
  document.getElementById("cityTypeStateLabelId").innerHTML='';
  }
 // alert(countryValue); 
 }
 
 function checkStateCityType(url,countryValue)
 {
  if ((countryValue == "US") || (countryValue == "CA") || (countryValue == "AU") || (countryValue == "MX")) {
   		var urls = url+'includes/get_state_list_ajax.jsp';
		myConn.connect(urls, 'GET', 'id='+countryValue, getStateListAjax);
	
	//document.getElementById(stateValue).options.length = 0; 
	//document.homeForm.stateValue 
  //document.getElementById("cityTypestateValueId").style.display='block'; 
  document.getElementById("cityTypeLocationId").style.display='block';
  }else {
  //document.getElementById("cityTypestateValueId").style.display='none';
  document.getElementById("cityTypeLocationId").style.display='none';
  }
 // alert(countryValue); 
 }
 function checkAddressTypeState(url,countryValue)
 {
 if ((countryValue == "US") || (countryValue == "CA") || (countryValue == "AU") || (countryValue == "MX")) {
   		var urls = url+'includes/get_state_list_ajax.jsp';
		myConn.connect(urls, 'GET', 'id='+countryValue, getStateListForAddAjax);
	
  //document.getElementById("AddressTypestateValueId").style.display='block'; 
  document.getElementById("AddressTypeStateLabelId").style.display='block';
  }else {
 // document.getElementById("AddressTypestateValueId").style.display='none';
  document.getElementById("AddressTypeStateLabelId").style.display='none';
  } 
 // alert(countryValue); 
 }
 
  function checkStatrLandMark(url,countryValue)
 {
  if ((countryValue == "US") || (countryValue == "CA") || (countryValue == "AU") || (countryValue == "MX")) {
   	
   		var urls = url+'includes/get_state_list_ajax.jsp';
		myConn.connect(urls, 'GET', 'id='+countryValue, getStateListForLandMAjax);
	 
  //document.getElementById("LandMarkStateValueId").style.display ='block'; 
  document.getElementById("LandMarkStateLandlId").style.display ='block'; 
  }else { 
  //document.getElementById("LandMarkStateValueId").style.display='';
  document.getElementById("LandMarkStateLandlId").style.display='none';
  }
 // alert(countryValue); 
 }
 
 function checkState2(countryValue)
 {
  if(countryValue == "US") { 
  document.getElementById("CardsateId").style.display=''; 
  
  }else {
document.getElementById("CardsateId").style.display='none'; 
  //document.getElementById("cityTypeStateLabelId").innerHTML='';
  } 
 // alert(countryValue);  
 }
 
 function checkState3(countryValue) 
 { 
  if(countryValue == "US") { 
  document.getElementById("cityTypestateValueId").style.display=''; 
  
  }else {
 document.getElementById("cityTypestateValueId").style.display='none'; 
  
  }
 }
 
 
 
 
 

 
 function getChildAge(TotalChild)
 {
 	if(TotalChild == 0) {
 		document.getElementById("childAgeLable").style.display='none'; 
 		document.getElementById("childAge1").style.display='none'; 
 		document.getElementById("childAge2").style.display='none';
 		document.getElementById("childAge3").style.display='none';
 		document.getElementById("childAge4").style.display='none';
 	 } 
    if(TotalChild == 1) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		
 		if(document.getElementById("childAge2").style.display == "") {
 			document.getElementById("childAge2").style.display='none';
 		}
 		if(document.getElementById("childAge3").style.display == "") {
 			document.getElementById("childAge3").style.display='none';
 		}
 		if(document.getElementById("childAge4").style.display == "") {
 			document.getElementById("childAge4").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 2) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		
 		if(document.getElementById("childAge3").style.display == "") {
 			document.getElementById("childAge3").style.display='none';
 		}
 		if(document.getElementById("childAge4").style.display == "") {
 			document.getElementById("childAge4").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 3) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		document.getElementById("childAge3").style.display='';
 		
 		if(document.getElementById("childAge4").style.display == "") { 
 			document.getElementById("childAge4").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 4) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		document.getElementById("childAge3").style.display='';
 		document.getElementById("childAge4").style.display='';
 	 }  
 }
 
 function getVacationChildAge(TotalChild)
 {
 	if(TotalChild == 0) {
 		document.getElementById("childAgeLable").style.display='none'; 
 		document.getElementById("childAge1").style.display='none'; 
 		document.getElementById("childAge2").style.display='none';
 		document.getElementById("childAge3").style.display='none';
 		document.getElementById("childAge4").style.display='none';
 		document.getElementById("childAge5").style.display='none';
 	 } 
    if(TotalChild == 1) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		
 		if(document.getElementById("childAge2").style.display == "") {
 			document.getElementById("childAge2").style.display='none';
 		}
 		if(document.getElementById("childAge3").style.display == "") {
 			document.getElementById("childAge3").style.display='none';
 		}
 		if(document.getElementById("childAge4").style.display == "") {
 			document.getElementById("childAge4").style.display='none'; 
 		}
 		if(document.getElementById("childAge5").style.display == "") {
 			document.getElementById("childAge5").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 2) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		
 		if(document.getElementById("childAge3").style.display == "") {
 			document.getElementById("childAge3").style.display='none';
 		}
 		if(document.getElementById("childAge4").style.display == "") {
 			document.getElementById("childAge4").style.display='none'; 
 		}
 		if(document.getElementById("childAge5").style.display == "") {
 			document.getElementById("childAge5").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 3) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		document.getElementById("childAge3").style.display='';
 		
 		if(document.getElementById("childAge4").style.display == "") { 
 			document.getElementById("childAge4").style.display='none'; 
 		}
 		if(document.getElementById("childAge5").style.display == "") {
 			document.getElementById("childAge5").style.display='none'; 
 		}
 	 } 
 	if(TotalChild == 4) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		document.getElementById("childAge3").style.display='';
 		document.getElementById("childAge4").style.display='';
 		if(document.getElementById("childAge5").style.display == "") {
 			document.getElementById("childAge5").style.display='none'; 
 		}
 	 } 
 	 
 	 if(TotalChild == 5) {
 		document.getElementById("childAgeLable").style.display=''; 
 		document.getElementById("childAge1").style.display=''; 
 		document.getElementById("childAge2").style.display='';
 		document.getElementById("childAge3").style.display='';
 		document.getElementById("childAge4").style.display='';
 		document.getElementById("childAge5").style.display='';
 		
 	 }   
 }
 
 
 function checkedAmenity()
 {
  var iTotalLength = document.getElementById("home1").chkAmenity.length; 
 	 for(var iCnt=0; iCnt<iTotalLength ; iCnt++)
 	 {
 	   if(document.getElementById("home1").chkAmenity[iCnt].checked == true) {
 	     var strValue = document.getElementById("home1").chkAmenity[iCnt].value;
 	     newHidden = document.createElement("input"); 
		 newHidden.setAttribute("type","hidden");
		 newHidden.setAttribute("id","chkAmenity");
		 newHidden.setAttribute("name","chkAmenity");
		 newHidden.setAttribute("value",strValue); 
		 document.homeForm.appendChild(newHidden);
	 
 	   
 	   }
 	 }
  //document.homeForm.chkAmenity.value = document.getElementById("home1").chkAmenity[0].value; 
 // 
  messageObj.close();  
 }
 
 function getMoreCSS()
 {
 //alert(document.getElementById("advan_link").innerHTML); 
  document.getElementById("advan_link").setAttribute("text-decoration:","none");  
 }
 function submitContactUs(formName,actionName){
  eval("document."+formName).action=actionName;
  eval("document."+formName).submit();
 }
 
 function showHotelDetail(hotelDetail)
 {  
   switch(parseInt(hotelDetail))
   {
     case 1: 
    document.getElementById("hotelOverviewDetail").style.display=''; 
    document.getElementById("hotelMapDetail").style.display='none'; 
    document.getElementById("hotelPhotoDetail").style.display='none'; 
    document.getElementById("hotelRateDetail").style.display="none"; 
     document.getElementById("hotelReviewDetail").style.display='none';
      document.getElementById("changeSearchId").style.display='none';   
   break;
	 
	 case 2:
   	 document.getElementById("hotelOverviewDetail").style.display='none'; 
    document.getElementById("hotelMapDetail").style.display='none'; 
    document.getElementById("hotelPhotoDetail").style.display=''; 
    document.getElementById("hotelRateDetail").style.display="none"; 
     document.getElementById("hotelReviewDetail").style.display='none'; 
      document.getElementById("changeSearchId").style.display='none';  
   break;
	 
	 case 3:
     document.getElementById("hotelOverviewDetail").style.display='none'; 
    document.getElementById("hotelMapDetail").style.display=''; 
    document.getElementById("hotelPhotoDetail").style.display='none'; 
    document.getElementById("hotelRateDetail").style.display='none'; 
     document.getElementById("hotelReviewDetail").style.display='none'; 
      document.getElementById("changeSearchId").style.display='none';  
  break;
	 
	 case 4:
      document.getElementById("hotelOverviewDetail").style.display='none';  
    document.getElementById("hotelMapDetail").style.display='none'; 
    document.getElementById("hotelPhotoDetail").style.display='none'; 
     document.getElementById("hotelReviewDetail").style.display='none'; 
      document.getElementById("changeSearchId").style.display='none';  
    document.getElementById("hotelRateDetail").style.display=''; 
   break;
	 case 5:
      document.getElementById("hotelOverviewDetail").style.display='none';  
    document.getElementById("hotelMapDetail").style.display='none'; 
    document.getElementById("hotelPhotoDetail").style.display='none'; 
    document.getElementById("hotelRateDetail").style.display='none';
    document.getElementById("hotelReviewDetail").style.display=''; 
    document.getElementById("changeSearchId").style.display='none';  
     document.getElementById("hotelReviewDetailFrameId").src =  document.getElementById("hotelReviewUrlId").value;
   break;
   case 6:
      document.getElementById("hotelOverviewDetail").style.display='none';  
    document.getElementById("hotelMapDetail").style.display='none'; 
    document.getElementById("hotelPhotoDetail").style.display='none'; 
    document.getElementById("hotelRateDetail").style.display='none';
    document.getElementById("hotelReviewDetail").style.display='none'; 
    document.getElementById("changeSearchId").style.display='';
  //  document.getElementById("changeSearchId").value="6";
	//showSearchPanel(); 
   break;
   }
   
   //alert(document.getElementById("hotelRateDetail").innerHTML); 
 }
 
 //==============================================================
			// COMPARE PROPERTIES
//==============================================================	
	function comparePropertiesChk(checkBoxId) { 
		if( document.getElementById("compareProperties"+checkBoxId).checked == true ) { 
			myConn.connect('http://www.etripinfo.com/includes/comparehotelIds.jsp', 'POST', 'id='+checkBoxId, setCompareProperties);
			//myConn.connect('http://www.etripinfo.com/includes/comparehotelIds.jsp', 'POST', 'id='+checkBoxId, setCompareProperties);
			//myConn.connect('http://www.etripinfo.com/includes/comparehotelIds.jsp', 'POST', 'id='+checkBoxId, setCompareProperties);
			 
			
		}else{
			myConn.connect('http://www.etripinfo.com/includes/deleteCompareHotelIds.jsp', 'POST', 'id='+checkBoxId, deleteCompareProperties);
			//myConn.connect('http://www.etripinfo.com/includes/deleteCompareHotelIds.jsp', 'POST', 'id='+checkBoxId, deleteCompareProperties);
			//myConn.connect('http://www.etripinfo.com/includes/deleteCompareHotelIds.jsp', 'POST', 'id='+checkBoxId, deleteCompareProperties);
			
				
		} 
	}
	
	function checkToAll(formName,chkAllName,chkName) 
 {
  //get total checkbox controls in the list
  var iTotalLength = eval("document."+formName+"."+chkName+".length"); 
    // alert(iTotalLength); 
  if(!eval("document."+formName+"."+chkAllName).checked == true)
  { 
     if(parseInt(iTotalLength) > 0 )
	 { 
       for(var iCnt=0;iCnt < iTotalLength; iCnt++)
	   {
	      eval("document."+formName+"."+chkName+"["+iCnt+"]").checked = false; 		  
	   }
	 }
	 else
	 {
	  eval("document."+formName+"."+chkName).checked = false; 	 
	 }
	  
   }
   else
   {
     if(parseInt(iTotalLength) > 0 )
	 {
	   for(var iCnt=0;iCnt<iTotalLength; iCnt++)
	   {
	     eval("document."+formName+"."+chkName+"["+iCnt+"]").checked = true;
	   }
	 }
	 else
	 {
	   eval("document."+formName+"."+chkName).checked = true;
	 }
   }
   
 }//end of checkAll function
 
	function changeState(){
 var countryId=document.memberForm.country.value;
 //alert(countryId-1);
 if(countryId!=176)
 {
 eval("document.memberForm.state.disabled=true");
 }
 else
 eval("document.memberForm.state.disabled=false");
 }
 
 function getCardHolderName()
 {
  if(document.homeForm.chkCardHolder.checked == true) {
     document.homeForm.crediCardFirstname.value = document.homeForm.firstName.value;
     document.homeForm.crediCardLastname.value = document.homeForm.lastname.value;
  	} else {
  	 document.homeForm.crediCardFirstname.value = "";
     document.homeForm.crediCardLastname.value = "";
  	}
 }
 
 function showRates(hotelId)
 {
   var idIs ="showRateId"+hotelId; 
  if(document.getElementById(idIs).style.display == '') {
    document.getElementById(idIs).style.display = 'none';
  } else if(document.getElementById(idIs).style.display == 'none') { 
   document.getElementById(idIs).style.display= ''; 
   
  }
 }
 function showSearchPanel()
 {
  
  if(document.getElementById("changeSearchId").style.display == '') {
    document.getElementById("changeSearchId").style.display = 'none';
  } else if(document.getElementById("changeSearchId").style.display == 'none') { 
   document.getElementById("changeSearchId").style.display= ''; 
   
  }
 }
  function submitBookingLogin(formName,actionName,actionValue,page)
	{ 
	
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = "TRUE";	
	 eval("document."+formName+".actionToPerform").value = "LOGIN";		 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	function submitBookingRegister(formName,actionName,actionValue,page)
	{ 
	
	 eval("document."+formName+".actionType").value = actionValue;	
	 eval("document."+formName+".thisPage").value = "TRUE";		
	 eval("document."+formName+".actionToPerform").value = "REGISTER";	 		 
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();    
	}
	
	function checkNewMeber()
	{
		if(document.getElementById("chkNewMemberId").checked == true) {
		document.getElementById("newMemberId").style.display="";
		document.getElementById("newMemberLabelId").style.display="";
		document.getElementById("newMemberConfId").style.display="";
		document.getElementById("newMemberConfLabelId").style.display="";
		} else {
		document.getElementById("newMemberId").style.display="none";
		document.getElementById("newMemberLabelId").style.display="none";
		document.getElementById("newMemberConfId").style.display="none";
		document.getElementById("newMemberConfLabelId").style.display="none";
		}
	}
	
	function changeCardImg(cardValue)
	{
	if(cardValue == "AX") {
	document.getElementById("cardImgId").innerHTML="<img src='http://www.etripinfo.com/images/cvn_AX.gif' alt='cheap hotels booking' title='cheap hotels booking' />";
	}
	if(cardValue == "DS") {
	document.getElementById("cardImgId").innerHTML="<img src='http://www.etripinfo.com/images/cvn_CA.gif' alt='cheap hotels booking' title='cheap hotels booking' />";
	
	} 
	if(cardValue == "CA") {
	document.getElementById("cardImgId").innerHTML="<img src='http://www.etripinfo.com/images/cvn_CA.gif' alt='cheap hotels booking' title='cheap hotels booking' />";
	
	}
	if(cardValue == "VI") {
	document.getElementById("cardImgId").innerHTML="<img src='http://www.etripinfo.com/images/cvn_CA.gif' alt='cheap hotels booking' title='cheap hotels booking' />";
	
	}
	}
	
	
	function submitHotelNearBy(formName,actionName,actionValue,page,hotellongitute,hotellatitute,hotelId)
	{
	
	 eval("document."+formName+".actionType").value = actionValue;	 
	 eval("document."+formName+".thisPage").value = page;
	 eval("document."+formName+".hotelLongitude").value = hotellongitute;
	 eval("document."+formName+".hotelLatitude").value = hotellatitute;
	 eval("document."+formName+".hotelIds").value = hotelId;
	 eval("document."+formName).action = actionName;
	 eval("document."+formName).submit();  
	 displaySearchMessage("","")
	 setTimeout('closeMessage();',100000); 
	}