// JScript File
//This for Hotel pages
var totalguest=5;
var LoadXml;
var LoadTrustXml;
var LoadHotelDetailsXml
var ci="ci"
var co="co";
var pagenameHotelId=document.getElementById("pageName").value;
var pageNameID=new Array();
pageNameID=pagenameHotelId.split('|');

var pageName=pageNameID[1];
var HotelID=pageNameID[0];
//var Id="HL"+document.getElementById('HId').value;
if(querySth("hotelId")!=undefined)
 HotelID=querySt("hotelId");
var Id="HL"+HotelID;
DesigncheckBrowser();
function DesigncheckBrowser()
{

if(navigator.userAgent.indexOf("Safari")!=-1 && navigator.userAgent.indexOf("Chrome")==-1)
    {
     Dynamicdesignsafari();
    }
else
    {
     DynamicdesignIEandFireFox();
    }   
}
//Dynamicdesign();

// Fill City,Hotel combBox
ReadHotelDetails(Id)

//var cityHotel=new Array();
//cityHotel=strcityhotel.split('~~');
//var cmb=document.getElementById('cmdCityhotel');
//cmb.options[0]=new Option("Select a Hotel","-1");
//for(i=0;i<cityHotel.length;i++)
//{
//  var single=new Array();
//  cityHotelval=cityHotel[i];
//  single=cityHotel[i].toString().split('~');
//  cmb.options[i+1]=new Option(single[1]+","+single[2],single[0]);
//  if(single[0]==Id)
//  cmb.options[i+1].selected=true;
//} 

 var ArrDate=document.getElementById("month").value;
   var DepDate=document.getElementById("monthOut").value;
   var ArArr=new Array();
   var DpArr=new Array();
   ArArr=ArrDate.split(":");
   DpArr=DepDate.split(":");

 
  var mm=myscriptTime.getMonth();
  
  var yy=myscriptTime.getFullYear();
  var dd=myscriptTime.getDate();
   
   var odd=new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");		

   var j=0;
  var temp,tempnew;
  var strMonth,strMonthnew;
  var lenMonth=24;//lenMonth 12 is 1 year i.e 12-1 to increase/decrease the month length increase/decrease this variable
  var year=yy;
  var yearnew=yy;
  if(isLastDate1(dd,mm,year)=="true")
  {  
  for(i=mm;i<=mm+lenMonth-1;i++)
  {
  temp=i+1;
   if(temp%12==0)
  {
  year=yy + temp/12;
  }
  temp= temp%12;
 
  strMonth=getMonthName(temp);
 
  document.getElementById("month").options[j]= new Option(strMonth+" "+year,temp+":"+year);
   
  document.getElementById("monthOut").options[j]= new Option(strMonth+" "+year,temp+":"+year);
  j++;
  }
  }
  else if(isLastDateBefore(dd,mm,year)=="true")
  {
  
  for(i=mm;i<=mm+lenMonth;i++)
  {
  temp=i;
  if(temp%12==0)
  {
  year=yy + temp/12;
  }
  temp= temp%12;
  strMonth=getMonthName(temp);
  document.getElementById("month").options[j]= new Option(strMonth+" "+year,temp+":"+year);
   
   //for monthOut
    tempnew=i+1;
  if(tempnew%12==0)
  {
  yearnew=yy + tempnew/12;
  }
  tempnew= tempnew%12;
  strMonthnew=getMonthName(tempnew);
  document.getElementById("monthOut").options[j]= new Option(strMonthnew+" "+yearnew,tempnew+":"+yearnew);
  j++;
  }
  
  
  }
  
  else//Check out Month should start from next Month
  {
   for(i=mm;i<=mm+lenMonth;i++)
  {
  temp=i;
  if(temp%12==0)
  {
  year=yy + temp/12;
  }
  temp= temp%12;
  strMonth=getMonthName(temp);
  document.getElementById("month").options[j]= new Option(strMonth+" "+year,temp+":"+year);
   
   //for monthOut
    tempnew=i;
  if(tempnew%12==0)
  {
  yearnew=yy + tempnew/12;
  }
  tempnew= tempnew%12;
  strMonthnew=getMonthName(tempnew);
  document.getElementById("monthOut").options[j]= new Option(strMonthnew+" "+yearnew,tempnew+":"+yearnew);
  j++;
  }
  }
  get_date(document.getElementById("date"));
  get_date(document.getElementById("dateOut"));
  //loadDate();
 
  
  
 
 function getMonthName(s)
            {
            if(s==0)
            return "Jan";
             if(s==1)
            return "Feb";
             if(s==2)
            return "Mar";
             if(s==3)
            return "Apr";
             if(s==4)
            return "May";
            if(s==5)
            return "Jun";
             if(s==6)
            return "Jul";
              if(s==7)
            return "Aug";
            
             if(s==8)
            return "Sep";
             if(s==9)
            return "Oct";
            
             if(s==10)
            return "Nov";
            
             if(s==11)
            return "Dec";
            
             
            }
      function isLastDate1(date,month,year)
            {
          // alert(date);
            var  strReturn="false";
            
          
             if(month==0||month==2||month==4||month==6||month==7||month==9||month==11)
            {
            
            
            if(date==31)
            {
            strReturn="true";
            }
            }
         if(month==3||month==5||month==8||month==10)
            {
           
            if(date==30)
             {
				strReturn="true";
			 }
            }
            
             if(month==1)
            {
            
           
            if(year%4==0)
            {
				if(date==29)
				{
					strReturn="true";
				}
            }
            else
            {
				if(date==28)
				{
				 strReturn="true";
				}
            }
           
            
            }
            
            
            return strReturn;
            }
           
                      
             function isLastDateBefore(date,month,year)
            {
           
            var strReturn="false";
            
          
             if(month==0||month==2||month==4||month==6||month==7||month==9||month==11)
            {
            
            
            if(date==30)
            {
            strReturn="true";
            }
            }
         if(month==3||month==5||month==8||month==10)
            {
           
            if(date==29)
             {
				strReturn="true";
			 }
            }
            
             if(month==1)
            {
            
           
            if(year%4==0)
            {
				if(date==28)
				{
					strReturn="true";
				}
            }
            else
            {
				if(date==27)
				{
				 strReturn="true";
				}
            }
            
            
            }
            
            return strReturn;
            }
          
            	function Char_Check(Char_To_Be_Checked,Valid_Char)
				{
					checkStr = Char_To_Be_Checked;
					checkOK1=Valid_Char;
					var flag=0;  
					var allValid = true;
					for (i = 0;  i < checkStr.length;  i++)
					{
						ch = checkStr.charAt(i);
						for (j = 0;  j < checkOK1.length;  j++)
						{
						//alert(ch+" "+checkOK1.charAt(j));
						if (ch == checkOK1.charAt(j))
						{
						    flag=1;
							break;
						}
						}
						
						
						
					}
					if (flag==1)
						{
						allValid = false;
						//break;
						}
						
					return allValid;

				}
				
				 function get_Month_Number(monthnumber)
     {
      var MonName;
      switch(monthnumber)
       {
        case 1:
              MonName="01";
              break;
        case 2:
              MonName="02";
              break;
        case 3:
              MonName="03";
              break;
        case 4:
              MonName="04";
              break;
        case 5:
              MonName="05";
              break;
        case 6:
              MonName="06";
              break;
        case 7:
              MonName="07";
              break;
        case 8:
              MonName="08";
              break;
        case 9:
              MonName="09";
              break;
        case 10:
              MonName="10";
              break;
        case 11:
              MonName="11";
              break;
        case 12:
              MonName="12";
              break;
       }
      return MonName;
     }
     
     function get_date_number(dateid)
     {
     var get_value;
           var get_number;
           get_number=dateid.length;
          if(get_number==1)
          {
           get_value="0"+dateid;
          }
          else
          {
          get_value=dateid;
          }
        return get_value;
     }
				
            function opentrust()
            {
            var totoccupancy;
            var url;
            var ArrDate=document.getElementById("month");
            var DepDate=document.getElementById("monthOut");
            var one_day=1000*60*60*24;
            var ArArr=new Array();
            var DpArr=new Array()
            var ymIn=ArrDate.options[ArrDate.selectedIndex].value;
            var ymOut=DepDate.options[DepDate.selectedIndex].value;
            var Valid_Char="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_,+|}{<>?/.:;[]=''-~`\\ "+'"';
            //alert(ymOut);
            ArArr=ymIn.split(":");
            DpArr=ymOut.split(":");
           
            var In=new Date(ArArr[1],ArArr[0],document.getElementById("date").value);
            //alert(parseInt(ArArr[1])+1);
            //alert(In.getMonth());
            //alert(In.getFullYear());
            var Out=new Date(DpArr[1],DpArr[0],document.getElementById("dateOut").value);
            var Diff=Math.ceil((Out.getTime()-In.getTime())/(one_day)); 
            //var DIn=new Date(2007,11,21);
            var cIn=new Date(myscriptTime.getFullYear(),myscriptTime.getMonth(),myscriptTime.getDate()+1);
            var cOut=new Date(myscriptTime.getFullYear()+2,myscriptTime.getMonth(),myscriptTime.getDate()-1);
           
            if(document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value=="-1")
            {
            alert("Please select a destination");
            document.getElementById('cmdCityhotel').focus();
            return false;
            }    
            
             if(document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value!="-1")
            {
              ReadHotel(document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value);
            }          
            if(document.getElementById("date").value=="")
             {
             alert("Please enter arrival date");
             document.getElementById("date").focus();
             return false;
             }
            // else if(Char_Check(document.getElementById("date").value,Valid_Char)==false || isLastDate1(document.getElementById("date").value,ArArr[0],ArArr[1])=="false" || document.getElementById("date").value==0)
            // {
            // alert("Invalid Arrival Date");
            //document.getElementById("date").focus();
            // }
            else if(In<cIn)
            {
            alert("Arrival date should be greater than current date");
            document.getElementById("date").focus();
            }
            else if(document.getElementById("dateOut").value=="")
              {
               alert("Please enter departure date");
               document.getElementById("dateOut").focus();
               return false
              }
            else if(Out>cOut)
            {
            var s=new Date(cOut.setDate(cOut.getDate()+1));
            alert("Departure date should be less than  "+ (parseInt(s.getDate()))+"-"+getMonthName(s.getMonth())+"-"+s.getFullYear());
            document.getElementById("dateOut").focus();
            return false
            }
            else if(In>Out)
            {
            alert("Departure date cannot be prior to arrival date");
            document.getElementById("dateOut").focus();
            return false
            }
             else if((In.getDate()==Out.getDate())&&(In.getFullYear()==Out.getFullYear()) &&(In.getMonth()==Out.getMonth()) )
            {
            alert("Departure date cannot be same as arrival date");
            document.getElementById("dateOut").focus();
            return false;
            
            }
            
            else if(Diff>30)
             {
             alert("No of nights should be less than or equal to 30 days");
             document.getElementById("dateOut").focus();
             return false
             }
              else if(document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value==-1)
            {
            alert("Please select no. of adults");
            document.getElementById("Guests").focus();
            return false;
            
            } 
            
            else
            {   
          
           document.getElementById("calArrivalDateField").value=ArArr[1]+"-"+get_Month_Number((parseInt(ArArr[0])+1))+"-"+get_date_number(document.getElementById("date").value);
           document.getElementById("calDepartureDateField").value=DpArr[1]+"-"+get_Month_Number((parseInt(DpArr[0])+1))+"-"+get_date_number(document.getElementById("dateOut").value);
           document.getElementById("ccpSelectHotel").value="TJ-HL"+Id
           document.getElementById("occupancy").value=document.getElementById("Guests").value;
           document.getElementById("prsRoomCount").value=1;//document.getElementById("cmbRoomcount").value;
          if(document.getElementById('iata').value!=0)
          url="https://www.yourreservation.net/ibe/Gateway/main.html?ccpSelectCity="+document.getElementById('ccpSelectCity').value+"&calArrivalDateField="+document.getElementById("calArrivalDateField").value+"&calDepartureDateField="+document.getElementById("calDepartureDateField").value+"&ccpSelectCountry="+document.getElementById('ccpSelectCountry').value+"&ccpSelectHotel=TJ-"+document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value+"&iata="+document.getElementById('iata').value+"&language=EN&prsRoomCount="+document.getElementById("prsRoomCount").value;
          if(document.getElementById('code').value!=0)
          url="https://www.yourreservation.net/ibe/Gateway/main.html?ccpSelectCity="+document.getElementById('ccpSelectCity').value+"&calArrivalDateField="+document.getElementById("calArrivalDateField").value+"&calDepartureDateField="+document.getElementById("calDepartureDateField").value+"&ccpSelectCountry="+document.getElementById('ccpSelectCountry').value+"&ccpSelectHotel=TJ-"+document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value+"&iata="+document.getElementById('iata').value+"&language=EN&prsRoomCount="+document.getElementById("prsRoomCount").value+"&accessCode="+document.getElementById('code').value;
          if(document.getElementById('code').value==0 && document.getElementById('iata').value==0)
          url="https://www.yourreservation.net/ibe/Gateway/main.html?ccpSelectCity="+document.getElementById('ccpSelectCity').value+"&calArrivalDateField="+document.getElementById("calArrivalDateField").value+"&calDepartureDateField="+document.getElementById("calDepartureDateField").value+"&ccpSelectCountry="+document.getElementById('ccpSelectCountry').value+"&ccpSelectHotel=TJ-"+document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value+"&language=EN&prsRoomCount="+document.getElementById("prsRoomCount").value;
          var room;
          var j;
        var childurl;
         if(document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value<totalguest && document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value!=-1)
          {
          
              for(i=1;i<=1;i++)
              {
                var chid="cmbchildcnt"+i;
                
                 if(document.getElementById(chid)==null)
                {
            
                     window.location.href=url+getCookie("c_child");
                     return;
                }
                  if(i==1)
                totoccupancy=parseInt(document.getElementById(chid).value)+parseInt(document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value)
                //alert(document.getElementById(chid));
                if(document.getElementById(chid).value>=0)
                {
                 
                if(childurl==null)
                   childurl="&prsNumChildren="+document.getElementById(chid).value;
                else
                childurl+="&prsNumChildren="+document.getElementById(chid).value;
                    //alert(room);
                    for(j=1;j<=document.getElementById(chid).value;j++)
                     {
                   
                           if(i==1)
                              {
                                  var ageId="childagecmbchildcnt"+(parseInt(j)-1);
                                   //alert(ageId);
                               }
                            else
                            {
                                    var ageId="childagecmbchildcnt"+i+(j-1);
                                   // alert(document.getElementById(ageId).value);
                            }
                  if(document.getElementById(ageId).value=="<1")
                  {
                  childurl+="&prsRoomAge=0";
                  }
                  else
                  {          
                 childurl+="&prsRoomAge="+document.getElementById(ageId).value;
                  }
                       }
                 }
               }
               
              
          }
          else
          {
           totoccupancy=document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value;
          }
         } 
        //  totoccupancy=document.getElementById("Guests").options[document.getElementById("Guests").selectedIndex].value;
           setCookie("c_child",childurl+"&occupancy="+totoccupancy+"&quick=quick",1);
          //alert(url+"&occupancy="+totoccupancy+childurl+"&quick=quick");
         // alert(childurl);
          window.location.href=url+"&occupancy="+totoccupancy+childurl+"&quick=quick";//childurl
     
         
                   
            }
            function loadDate()
             {
             
             var mm=myscriptTime.getMonth();
			 var yy=myscriptTime.getFullYear();
			 var dd=myscriptTime.getDate();
            document.getElementById("date").value=(dd+1); 
            document.getElementById("dateOut").value=(dd+2);
             }
             
              function odddate_load(yearlist,monthlist,datelist)
		 {
		    var ctr=datelist;
		    var m=myscriptTime.getMonth();
			var s=myscriptTime.getFullYear();
			var b=myscriptTime.getDate();
			var cDate=new Date(myscriptTime.getFullYear(),myscriptTime.getMonth(),myscriptTime.getDate());
			//alert(ctr.name+"Name");
			if(ctr.name=="date")
			{
			var cDate1=new Date(cDate.setDate(cDate.getDate()+1));
			b=cDate1.getDate();
			var s=myscriptTime.getFullYear();
			}
			if(ctr.name=="dateOut")
			{
			var cOutDate1=new Date(cDate.setDate(cDate.getDate()+2));
			b=cOutDate1.getDate();
			var s=myscriptTime.getFullYear();
			}
		 var a=monthlist;
		 var date1=new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
		// alert(yearlist.options[yearlist.selectedIndex].value);
		            if (yearlist==s)	
									
									{
										 if (a==0 || a==2 || a==4 || a==6 || a==7 || a==9 || a==11)
	                                        {
	                                            for(i=b-1,j=0;i<date1.length,j<ctr.options.length;i++,j++)
	                                             {
		                                            ctr.options.length=date1.length-(b-1);	  
		                                            ctr.options[j]=new Option(date1[i],date1[i]);
	                                                }
	                                        }
	                                      else
	                                        {
	                                            for(i=b-1,j=0;i<date1.length,j<ctr.options.length;i++,j++)
	                                                {
		                                                ctr.options.length=date1.length-(b);	  
		                                                ctr.options[j]=new Option(date1[i],date1[i]);
	                                                 }
	  
	                                        }
	                                 }
	                                                                       
				else 
			        {
					         if (a==0 || a==2 || a==4 || a==6 || a==7 || a==9 || a==11)
	                          {
	                          ctr.options.length=odd.length-1;
			    	         var i;
					         for(i=0;i<=odd.length-1;i++)
						        {
							        ctr.options[i]=new Option(odd[i],i+1);
						        }
					         
						      }
						     else
						     {
						      ctr.options.length=odd.length-1;
			    	         var i;
					         for(i=0;i<=odd.length-2;i++)
						        {
							        ctr.options[i]=new Option(odd[i],i+1);
						        }
						     
						     
						     }   
				    } 
				    
		 		 
		 }
		 
		 
		 function get_date(datelist)
 {   
     var monval;
     var ctrd=datelist;
     a=myscriptTime.getMonth();
     y=myscriptTime.getFullYear();
     var date1=new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
     //document.getElementById("date");
     if(ctrd.name=='date')
      {
        b=myscriptTime.getDate();
       // alert(a);
        if ((a==0 || a==2 || a==4 || a==6 || a==7 || a==9) &&(b==31 || b==30))
        {
        if(b==31)
        {
           b=1;
           
           if(a==0)
	          {
	          
	          
	          if (y%4==0)
	         {
	           //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+1);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	         }
	           else
	             {
	               //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+2);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	             
	             }  
	          
	        // alert("Feb")
	          }
	        
	          else
	          {
					for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	              {
	 	         ctrd.options.length=date1.length-(b);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	              }
	          
	         }  
	         
	           if(a==6)
	          {
	          	 b=1;
                 for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	            {
	 	           ctrd.options.length=date1.length-(b-1);	  
		           ctrd.options[j]=new Option(date1[i],date1[i]);
	            }
	          }
	   
	    monval=getMonthValue(a+1,y);
	    //alert(monval);
	    document.getElementById("month").value=monval;
        document.getElementById("monthOut").value=monval;
        }
        if(b==30)
        {
        //alert(date1.length+"Arr");
       ctrd.options.length=date1.length-(b);	 
           for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {
				ctrd.options[j]=new Option(date1[i],date1[i]);
	         }
	    monval=getMonthValue(a+1,y);
	    document.getElementById("date").value=31;
	    //document.getElementById("month").value=monval;
        document.getElementById("monthOut").value=monval;
        }
        
        
        //disp_date(document.getElementById("date"),document.getElementById("month"))
	     } 
	     else if((a==3 || a==5 || a==8 || a==10) && (b==30 || b==29))
	     {
	   // alert("1");
         if(b==30)
         {
           b=1;
          
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
								{
									ctrd.options.length=date1.length-(b-1);	  
									ctrd.options[j]=new Option(date1[i],date1[i]);
								}
              
           	monval=getMonthValue(a+1,y);
			//alert(monval)
			document.getElementById("month").value=monval;
			document.getElementById("monthOut").value=monval;
         }
         if(b==29)
         {
         
         ctrd.options.length=date1.length-(b+1);
			for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
				{
					//alert(b);	  
					ctrd.options[j]=new Option(date1[i],date1[i]);
				}
			monval=getMonthValue(a+1,y);
			document.getElementById("date").value=30;
			//document.getElementById("month").value=monval;
			document.getElementById("monthOut").value=monval;
         
         }
         //disp_date(document.getElementById("date"),document.getElementById("month"));
	     } 
	      else if (a==0 || a==2 || a==4 || a==6 || a==7 || a==9)
	    {
	    disp_date(document.getElementById("date"),document.getElementById("month"));
	       /* for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {
				ctrd.options.length=date1.length-(b);	  
				ctrd.options[j]=new Option(date1[i],date1[i]);
	        }*/
	  }
	  else if(a==1)
	    {
	       if (y%4==0)
	         {
	           if(b==29)
	           {
	           	 b=1;
                 for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	            {
	 	           ctrd.options.length=date1.length-(b-1);	  
		           ctrd.options[j]=new Option(date1[i],date1[i]);
	            }
	        monval=getMonthValue(a+1,y);
			document.getElementById("date").value=1;
			document.getElementById("month").value=monval;
			document.getElementById("monthOut").value=monval;
	           
	           }
	           
	            else if(b==28)
	            {
	              	ctrd.options.length=date1.length-(b+2);	 
           for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {
				ctrd.options[j]=new Option(date1[i],date1[i]);
	         }
	         monval=getMonthValue(a+1,y);
			document.getElementById("date").value=29;
			//document.getElementById("month").value=monval;
			document.getElementById("monthOut").value=monval;
	                 
	           }     
	           else
	           {
	            //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+2);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	            }     
	   }
	           else
	             {//Not Leaf
	            
	               if(b==27)
	               {
	                  ctrd.options.length=date1.length-(b+3);	 
						for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
							{
								ctrd.options[j]=new Option(date1[i],date1[i]);
							}
							monval=getMonthValue(a+1,y);
							document.getElementById("date").value=28;
							//document.getElementById("month").value=monval;
							document.getElementById("monthOut").value=monval;
	               
	               
	               }
	               else if(b==28)
	               {
	               	    b=1;
						for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
						{
	 					ctrd.options.length=date1.length-(b-1);	  
						ctrd.options[j]=new Option(date1[i],date1[i]);
						}
						monval=getMonthValue(a+1,y);
						document.getElementById("date").value=1;
						document.getElementById("month").value=monval;
						document.getElementById("monthOut").value=monval;
	               
	               
	               }
	               else
	               {
	               //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+3);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	                } 
	             
	             }    
	        
	    }
	  else if((a==11)&&(b==31 || b==30))
	  {
	 
	    if(b==30)
	     {
	     	ctrd.options.length=date1.length-(b);	 
           for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {
				ctrd.options[j]=new Option(date1[i],date1[i]);
	         }
	            monval=getMonthValue(a,y);
	            monval1=getMonthValue(0,y+1)
	           	document.getElementById("month").value=monval;
				document.getElementById("monthOut").value=monval1;
	     
	     }
	     if(b==31)
	     {
	       b=1;
          
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
								{
									ctrd.options.length=date1.length-(b-1);	  
									ctrd.options[j]=new Option(date1[i],date1[i]);
		    					}
	           //monval=getMonthValue(a,y);
	           monval1=getMonthValue(0,y+1)
	           document.getElementById("month").value=monval1;
			   document.getElementById("monthOut").value=monval1;
	     }
	     
	  }   
	  else
	  {
	     disp_date(document.getElementById("date"),document.getElementById("month"));
	  /* for(i=b,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	  {
	 
		ctrd.options.length=date1.length-(b-1);	  
		ctrd.options[j]=new Option(date1[i],date1[i]);
	  }*/
	  
	  }
	  
         
     //  alert(b);
      }
      else if(ctrd.name=='dateOut')
      {
      b=myscriptTime.getDate();
      
        if ((a==0 || a==2 || a==4 || a==6 || a==7 || a==9 ) && (b==31 || b==30))
        {
       
          if(b==31)
          {
          b=2;
          
	          if(a==0)
	          {
	          
	          
	          if (y%4==0)
	         {
	         
	         
	           //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+1);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	         }
	           else
	             {
	               //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+2);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	             
	             }  
	          
	         
	          }
	          else
	          {
					for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
					{
	 					ctrd.options.length=date1.length-(b);	  
						ctrd.options[j]=new Option(date1[i],date1[i]);
					}
	          
	          }
	          if(a==6)
	          {
	         
	          	 b=2;
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	          {
	 	         ctrd.options.length=date1.length-(b-1);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	          }
	   
	          }
	          
	          
				monval=getMonthValue(a+1,y);
				document.getElementById("month").value=monval;
				document.getElementById("monthOut").value=monval;
				//disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
          }
          if(b==30)
        {
       b=1;
       
         if(a==0)
	          {
	          
	          
	          if (y%4==0)
	         {
	           //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+1);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	           }
	           else
	             {
	               //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b-1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+2);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	             
	             }  
	          
	        
	          }
       else 
        {
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {//XXXX
				ctrd.options.length=date1.length-(b);	  
				ctrd.options[j]=new Option(date1[i],date1[i]);
	         }
	    } 
	    
	    
	     if(a==6)
	          {
	         
	          	 b=1;
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	          {
	 	         ctrd.options.length=date1.length-(b-1);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	          }
	   
	          }  
	    monval=getMonthValue(a+1,y);
	    document.getElementById("date").value=31;
	    //document.getElementById("month").value=monval;
        document.getElementById("monthOut").value=monval;
        }
          
	  } 
	     else if((a==3 || a==5 || a==8 || a==10) && (b==30 || b==29))
	     {
				
				if(b==30)
					{
							monval=getMonthValue(a+1,y);
							document.getElementById("month").value=monval;
							document.getElementById("monthOut").value=monval;
							//disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
							b=2;
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
								{
									ctrd.options.length=date1.length-(b-1);	  
									ctrd.options[j]=new Option(date1[i],date1[i]);
								}
					}
					if(b==29)
					{
						 b=1;
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	          {
	 	         ctrd.options.length=date1.length-(b-1);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	          }
	    
					
					
		}
					
	      
	     } 
	      else if (a==0 || a==2 || a==4 || a==6 || a==7 || a==9)
	    {
	    //disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	        for(i=b+1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	        {
				ctrd.options.length=date1.length-(b+1);	  
				ctrd.options[j]=new Option(date1[i],date1[i]);
	       }
	  }
	  else if((a==11)&&(b==31 || b==30))
	  {
	  
	    if(b==30)
	     {
	     
	      b=1;
          
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
								{
									ctrd.options.length=date1.length-(b-1);	  
									ctrd.options[j]=new Option(date1[i],date1[i]);
		    					}
		      }				
	     
	     	     if(b==31)
	               {
	                     b=2;
          
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
								{
									ctrd.options.length=date1.length-(b-1);	  
									ctrd.options[j]=new Option(date1[i],date1[i]);
		    					}
	          
	               }
						
						
	  
	  
	  
	  }
	  else if(a==1)
	    {
	       if (y%4==0)
	         {
	         
	           if(b==29)
	           {
	           				b=2;
							for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
					{
	 	           ctrd.options.length=date1.length-(b-1);	  
		           ctrd.options[j]=new Option(date1[i],date1[i]);
	                }
	           }
	           else if(b==28)
	            {
	              	 b=1;
                    for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	               {
	 					ctrd.options.length=date1.length-(b-1);	  
						ctrd.options[j]=new Option(date1[i],date1[i]);
	                }
                }      
	                  //Vijay disp_date(document.getElementById("date"),document.getElementById("month"));
	             else
	             {
	             for(i=b+1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+3);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	              }   
	         }
	         /* else
	             {
	               //disp_date(document.getElementById("date"),document.getElementById("month"));
	             for(i=b+1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+4);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	             
	             }  */    
	        
	    else
	  {
	  //alert(b+"D");
	  if(b==27)
	  {
	       b=1;
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	          {
	 	         ctrd.options.length=date1.length-(b-1);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	          }
	   }
	   else if(b==28)
	   {
	        b=2;
           for(i=b-1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
	          {
	 	         ctrd.options.length=date1.length-(b-1);	  
		         ctrd.options[j]=new Option(date1[i],date1[i]);
	          }
	   
	   }
	   else
	   {
	             for(i=b+1,j=0;i<date1.length-3,j<ctrd.options.length;i++,j++)
	                {
		                ctrd.options.length=date1.length-(b+4);	  
		                ctrd.options[j]=new Option(date1[i],date1[i]);
	                 }
	              } 
	   }
   }
   else
   {
   if(a==3 || a==5 || a==10 || a==8)
   {
             for(i=b+1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
					{
	 					ctrd.options.length=date1.length-(b+2);	  
						ctrd.options[j]=new Option(date1[i],date1[i]);
					}
   }
   else
   {
  for(i=b+1,j=0;i<date1.length,j<ctrd.options.length;i++,j++)
					{
	 					ctrd.options.length=date1.length-(b+1);	  
						ctrd.options[j]=new Option(date1[i],date1[i]);
					}
   }					
   
   }
 }
}    
	

function getMonthValue(mon,yr)
{       
       return mon+":"+yr;
 }
function disp_date(datelist,monthlist)
 {



   var ctr=datelist;
  var m=myscriptTime.getMonth();
  var s=myscriptTime.getFullYear();
  var b=myscriptTime.getDate();
  var cDate=new Date(myscriptTime.getFullYear(),myscriptTime.getMonth(),myscriptTime.getDate());
 //alert(ctr.name+"Name");
 if(ctr.id=="date")
 {
 var cDate1=new Date(cDate.setDate(cDate.getDate()+1));
 //alert(cDate1.getDate());
  b=cDate1.getDate();

 // alert(b+"Date");
 }
 if(ctr.id=="dateOut")
 {
 var cOutDate1=new Date(cDate.setDate(cDate.getDate()+2));
 b=cOutDate1.getDate();

// alert(b+"OutDate")
 } /**/
  datelist.value;
  var ym=monthlist.value;
  //alert(ym);
  var ArYm=new Array();
  ArYm=ym.split(":");
 // alert(ym+"Disp");
  //alert(ArYm[0]+"disp");
  //alert(ArYm[1]);
  
  //var s=d.getFullYear();
  //var n=4;//Enter the no.of Years
  var i;
 //document.getElementById("datelist");
  //alert(monthlist.options[monthlist.selectedIndex].value);
 // alert(m);
// alert(ArYm[0]);
  switch(ArYm[0])
     {
     case "0":
              
     
				if (ArYm[0]==m)
				   {
				   odddate_load(ArYm[1],ArYm[0],datelist)
				   }
				 else
				    { 
							ctr.options.length=odd.length;
							var i;
								for(i=0;i<odd.length;i++)
									{
										ctr.options[i]=new Option(odd[i],i+1);
									}	
					}
					
				
				 
						
                  break;
      case "1":
								      
                          if(ArYm[1]==s && ArYm[0]==m )
                           {  
                        
                               if (ArYm[1]%4==0)
	                               {
	                                       
	                                         for(i=b-1,j=0;i<odd.length-3,j<ctr.options.length;i++,j++)
	                                             {
		                                                  ctr.options.length=odd.length-(b+1);	  
		                                                  ctr.options[j]=new Option(odd[i],odd[i]);
		                                          }
	                                }
	                            else
	                                {
	                                          for(i=b-1,j=0;i<odd.length-3,j<ctr.options.length;i++,j++)
	                                                {
		                                                   ctr.options.length=odd.length-(b+2);	  
		                                                   ctr.options[j]=new Option(odd[i],odd[i]);
	                                                 }
	                                 } 
	                        }                   
	                   //----------------------------------------------------------------------              
                         else
                          {              
                    
                  if (ArYm[1]%4==0)
                    {
                       //alert(odd[2]);
                       //odddate_load(ArYm[1],ArYm[0],datelist)
                       ctr.options.length=odd.length-2;
                       for(i=0;i<odd.length-2;i++)
                         {
                             ctr.options[i]=new Option(odd[i],i+1);
                         }                  
				  
                    }	
                  else
                  {
                  
                 // odddate_load(ArYm[1],ArYm[0],datelist)
                  ctr.options.length=odd.length-3;
                  var i;
                  for(i=0;i<odd.length-3;i++)
                   {
                     ctr.options[i]=new Option(odd[i],i+1);
                   }
                  }  
                 } 
				   break;
	   case "2":		
					if (ArYm[0]==m)
					  {
					  odddate_load(ArYm[1],ArYm[0],datelist)
					  }
					else
					{
				  	ctr.options.length=odd.length;
					var i;
                     for(i=0;i<odd.length;i++)
							{
                                ctr.options[i]=new Option(odd[i],i+1);
							}
					}		
					
					break;
        case "3": 
					if (ArYm[0]==m)
						{
							odddate_load(ArYm[1],ArYm[0],datelist)
						}
					else
					 {
				 		ctr.options.length=odd.length-1;
						var i;
						for(i=0;i<odd.length-1;i++)
							{
								ctr.options[i]=new Option(odd[i],i+1);
							}
					 }		
                	
				   break;	
		case "4":
						if (ArYm[0]==m)
					  {
					  odddate_load(ArYm[1],ArYm[0],datelist)
					  }
					else
					  {
					    ctr.options.length=odd.length;
						var i;
						for(i=0;i<odd.length;i++)
							{
								ctr.options[i]=new Option(odd[i],i+1);
							}
                           
                       }  
                         break;	 
		case "5":
				
					if (ArYm[0]==m)
						{
							odddate_load(ArYm[1],ArYm[0],datelist)
						}
					 else
					  {
						  ctr.options.length=odd.length-1;
					      var i;
						  for(i=0;i<odd.length-1;i++)
							{
								ctr.options[i]=new Option(odd[i],i+1);
							}	
						}		
					 break;
		 case "6":
				if (ArYm[0]==m)
					  {
					  odddate_load(ArYm[1],ArYm[0],datelist)
					  }
				else
				{			
		          ctr.options.length=odd.length;
                  var i;
                  for(i=0;i<odd.length;i++)
                  {
                     ctr.options[i]=new Option(odd[i],i+1);
                  }
                } 
                  break;	
                 
		        	           
          case "7":
					if (ArYm[0]==m)
					  {
					  odddate_load(ArYm[1],ArYm[0],datelist)
					  }
					else          
					{
					ctr.options.length=odd.length;
					var i;
					for(i=0;i<odd.length;i++)
						{
							ctr.options[i]=new Option(odd[i],i+1);
						}
					}	
                  break;	   
           case "8":
					if (ArYm[0]==m)
						{
							odddate_load(ArYm[1],ArYm[0],datelist)
						}
					else
					  {
						ctr.options.length=odd.length-1;
						var i;
						for(i=0;i<odd.length-1;i++)
							{
								  ctr.options[i]=new Option(odd[i],i+1);
							}	
						}	
						break;
						
			case "9":
						if (ArYm[0]==m)
							{
								odddate_load(ArYm[1],ArYm[0],datelist)
							}
						else
						{	 
			     	   	  ctr.options.length=odd.length;
						  var i;
						  for(i=0;i<odd.length;i++)
							{
                               ctr.options[i]=new Option(odd[i],i+1);
							}
						}	
                           break;	   
	         case "10":
							// alert(b+"Nov")
							if (ArYm[0]==m)
								{
									odddate_load(ArYm[1],ArYm[0],datelist)
								}
							else
							  {
							   ctr.options.length=odd.length-1;
							   var i;
								 for(i=0;i<odd.length-1;i++)
									 {
										ctr.options[i]=new Option(odd[i],i+1);
										}	
								}		
								break;
			case "11":		
							if (ArYm[0]==m)
							 {
								 odddate_load(ArYm[1],ArYm[0],datelist)
							 }
							else
							{					
							 ctr.options.length=odd.length;
						     var i;
							 for(i=0;i<odd.length;i++)
							  {
                                ctr.options[i]=new Option(odd[i],i+1);
							  }
							} 
                              break;	   		
		      default:
		              alert("select Month");
		         	
                  
           }
           }
 
 function setcType()
{
//document.getElementById("Exp").style.cursor='hand';
document.getElementById("indate").style.cursor='hand';
document.getElementById("outdate").style.cursor='hand';
}
function invokeCal(vtype)
{
//alert("1");
var ArrDate=document.getElementById("month").value;
   var DepDate=document.getElementById("monthOut").value;
   var ArArr=new Array();
   var DpArr=new Array();
   ArArr=ArrDate.split(":");
   DpArr=DepDate.split(":");
   var dtArrival;
   frmname =document.getElementById("f1").id;
	//alert(frmname);
	if (vtype=='ci')
	{
	 var dd=document.getElementById("date").value
	 var mm=parseInt(ArArr[0])+1;
	 var yy=ArArr[1];
	// alert(mm);
	 GoToCalendar('Cal','CHECK-IN',frmname,dd,mm,yy,dtArrival)
	}
	else if (vtype=='co')
	{
	 /*var dd=currform.cmbDepartDay.options[currform.cmbDepartDay.selectedIndex].value
	 var mm=currform.cmbDepartMonth.options[currform.cmbDepartMonth.selectedIndex].value
	 var yy=currform.cmbDepartYear.options[currform.cmbDepartYear.selectedIndex].value*/
	
	 var mm=parseInt(ArArr[0])+1;
	 var yy=ArArr[1];
	  var dd=parseInt(document.getElementById("date").value);
	
	/* if((mm=="1" || mm=="3" || mm=="5" || mm=="7" || mm=="8" || mm=="10") && dd=="31")
	 { 
		  dd=1;
	      mm=mm+1;
	 }
	else if((mm=="4" || mm=="6" || mm=="9" || mm=="11") && dd=="30")
	{
		dd=1;
		mm=mm+1;
	}
	else if(mm=="2")
	{
	
	 if(yy%4==0 && dd=="29")
	 {
	  dd=1;
	   mm=mm+1;
	 }
	else
	 {
	 if(dd=="28")
	 {
	 dd=1;
	 m=mm+1;
	 }
	
	}
  }	
	else if(mm=="12" && dd=="31")
	{
	
	mm=1;
	yy=parseInt(ArArr[1])+1;
	dd=1;
	}
	else
	{
	
	dd=parseInt(document.getElementById("date").value)+1;
	
	}
	 //alert(dd);*/
	
	 dtArrival = mm+"-"+yy+"-"+dd
	 GoToCalendar('Cal','CHECK-OUT',frmname,dd,mm,yy,dtArrival)
	}
}

function GoToCalendar(CalName,LinkName,frm,day,month,year,dtArrival) {
		var myFrm;
		var selDate;
		var thisWinFrm;
		
		thisWinFrm=document.forms[frm];
		
		myFrm=thisWinFrm;
				
		//if(LinkName=='CHECK-IN') {
			selDate=month + " " + year + " " + day
		//}		
		myselDate=selDate.split(' ')
		selDate=''
		
		for(i=0;i<myselDate.length;i++) {
			if(selDate=='') {
				selDate=myselDate[i]
			}
			else {
				selDate=selDate+ '-' +myselDate[i]
			}
		}		
		//alert(selDate);
		//return;
		//alert(CalName);
		//alert(LinkName)
		//alert(frm);
		//alert(selDate);
		//alert(dtArrival);
		//calendar_url="../../TajHotelFinder/Res_Calendar.aspx?formName="+frm+"&formCtrl="+LinkName+"&selDate="+selDate + "&selDate1=" + dtArrival
		calendar_url="Res_Calendar.aspx?formName="+frm+"&formCtrl="+LinkName+"&selDate="+selDate + "&selDate1=" + dtArrival
		var MyCalWindow_Width=250;//window.screen.width/3-60
		var MyCalWindow_Height=190;//window.screen.height/2-150
		var MyCalWindow_Left=400;//MyCalWindow_Width/2
		var MyCalWindow_Top=200;//MyCalWindow_Height/2
		
		this.MyCalWindow_Open=true;
		
		//MyCalWindow=window.open(calendar_url,CalName,"toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable,alwaysRaised,titlebar=no,width="+MyCalWindow_Width+",height="+MyCalWindow_Height+",left="+MyCalWindow_Left+",top="+MyCalWindow_Top+"");
		MyCalWindow=window.open(calendar_url,CalName,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+MyCalWindow_Width+",height="+MyCalWindow_Height+",left="+MyCalWindow_Left+",top="+MyCalWindow_Top+"");
	}

function calendarCall(formCtrl,myMonthYear,dtD) 
              {	
            
	 var str=eval(myMonthYear.split(' '));
	 var str1=str[0].slice(0,3);
	 //alert(dtD);
/*alert(str)
alert(str1)

alert(formCtrl);
  alert("Cal Calll");*/
	 putdate(dtD,str1,str[1],formCtrl);
	}
	
	
	function putdate(dd,mm,yy,ctrlname)
{
//alert(mm);
var cOut=new Date(myscriptTime.getFullYear()+2,myscriptTime.getMonth(),myscriptTime.getDate()-1);
//var cw=new Date(cOut.setMonth(cOut.getMonth()+1));
//alert(cw);
//alert(getMonthName(cOut.setMonth(2)));
//var cIn=new Date(myscriptTime.getFullYear()+1,myscriptTime.getMonth()-1,myscriptTime.getDate()-1);
//alert(cIn);
var mNum=getMonthNumber(mm);
//alert(mNum);
var Out=new Date(yy,mNum,dd);
var my=mm+" "+yy;
var currform=document.getElementById("f1");
//alert(myscriptTime.getMonth());
//alert(myscriptTime.getDate()-1);


	if (ctrlname == 'CHECK-IN')
	{
	//alert("2");
	/*if(yy>=2008 && mNum>=9 && dd>=myscriptTime.getDate()-1)
	{
alert("Arrival Date Should be less than "+parseInt(myscriptTime.getDate()-1)+"-"+mm.toUpperCase()+"-"+yy);
return false;

}*/
		//set year
		for(i=0;i<currform.month.options.length;i++)
		{
		
			if (currform.month.options[i].text ==my){
			
				currform.month.options[i].selected = true;
				break;}
		}
		//ArrivalYearChanged();

		//set month
		/*for(i=0;i<currform.cmbArrivalMonth.options.length;i++)
		{
			if (currform.cmbArrivalMonth.options[i].text.slice(0,3) ==mm){
				currform.cmbArrivalMonth.options[i].selected = true;
				break;}
		}
		ChangeOptionDays(ADaysObject,AMonthObject,AYearObject,'A');*/
		//set day
		//alert(dd+"put");
		disp_date(document.getElementById("date"),document.getElementById("month"));
		for(i=0;i<currform.date.options.length;i++)
		{
		//alert(currform.date.options[i].text);
			if (currform.date.options[i].text ==dd){
				currform.date.options[i].selected = true;
				break;}
		}
		//AddNights2Depart();
		changeDate();
		
	}
	
	if (ctrlname == 'CHECK-OUT')
	{
	if(Out>cOut)
            {
            alert("Departure date should be less than  "+ (parseInt(cOut.getDate())+1)+"-"+getMonthName(cOut.getMonth())+"-"+cOut.getFullYear());
            return false;
            //document.getElementById("dateOut").focus();
            }

	//set day
	for(i=0;i<currform.monthOut.options.length;i++)
		{
		
			if (currform.monthOut.options[i].text ==my){
			//alert("1");
				currform.monthOut.options[i].selected = true;
				break;}
		}
	//set month
	/*for(i=0;i<currform.cmbDepartMonth.options.length;i++)
	{
		if (currform.cmbDepartMonth.options[i].text.slice(0,3) ==mm){
			currform.cmbDepartMonth.options[i].selected = true;
			break;}
	}*/

	//set year
	disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));	
	for(i=0;i<currform.dateOut.options.length;i++)
		{
			if (currform.dateOut.options[i].value ==dd){
				currform.dateOut.options[i].selected = true;
				break;}
		}
	}
	
}

function getMonthNumber(s)
            {
            if(s=="Jan")
            return 0;
             if(s=="Feb")
            return 1;
             if(s=="Mar")
            return 2 ;
             if(s=="Apr")
            return 3;
             if(s=="May")
            return 4;
            if(s=="Jun")
            return 5;
             if(s=="Jul")
            return 6;
              if(s=="Aug")
            return 7;
            if(s=="Sep")
            return 8;
             if(s=="Oct")
            return 9;
            if(s=="Nov")
            return 10;
            if(s=="Dec")
            return 11;
            
             
            }
            
            
function changeDate()
 {


 //alert(document.getElementById("month").value);
 //alert(document.getElementById("month").options[0].value);
 //alert(document.getElementById("monthOut").options[0].value);
 var ArrDate=document.getElementById("month").value;
 var DepDate=document.getElementById("monthOut").selectedIndex;
 var ArArr=new Array();
 //var DpArr=new Array();
 ArArr=ArrDate.split(":");
 //DpArr=DepDate.split(":");
 var mm=parseInt(ArArr[0])+1;
//alert(mm);
 var yy=ArArr[1];
 var dd=parseInt(document.getElementById("date").value);
 
 if(parseInt(myscriptTime.getMonth())+1==mm && parseInt(myscriptTime.getFullYear())+2==yy && dd>parseInt(myscriptTime.getDate())-2)
	{

	var dt=new Date(myscriptTime.getFullYear()+2,myscriptTime.getMonth(),myscriptTime.getDate());

	var ndt=new Date(dt.setDate(dt.getDate()-1));
	var mName=getMonthName(ndt.getMonth());
	alert("Arrival date should be less than "+parseInt(ndt.getDate())+"-"+mName+"-"+ndt.getFullYear());
	document.getElementById("date").value=1;
	return false;

	//disp_date(document.getElementById("dateOut"),document.getElementById("month"));
	}
 
 
 if((mm=="1" || mm=="3" || mm=="5" || mm=="7" || mm=="8" || mm=="10") && dd=="31")
	 { 
		if(document.getElementById("month").options[0].value==document.getElementById("monthOut").options[0].value)
		{
		  document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex+1;
		 // alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	    }
	    else
	    {
	    document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
		 // alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	    }
	      
	 }
	else if((mm=="4" || mm=="6" || mm=="9" || mm=="11") && dd=="30")
	{
	    if(document.getElementById("month").options[0].value==document.getElementById("monthOut").options[0].value)
		{
		 document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex+1;
		// alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	    }
	    else
	    {
	    document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
		// alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	    }  
	}
	else if(mm=="2")
	{
	//if(parseInt(myscriptTime.getMonth())+1==mm && parseInt(myscriptTime.getFullYear())+1==yy && dd>parseInt(myscriptTime.getDate())-2)
	//{
	//alert("O");
	
	//var mName=getMonthName(mm-1)
	//alert("Arrival Date Should be less than "+parseInt(myscriptTime.getDate()-1)+"-"+mName.toUpperCase()+"-"+yy);
	//document.getElementById("date").value=1;
	//return false;

	//disp_date(document.getElementById("dateOut"),document.getElementById("month"));
	//}
		
	 if(yy%4==0 && dd=="29")
	 {
	  if(document.getElementById("month").options[0].value==document.getElementById("monthOut").options[0].value)
		{
	 document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex+1;
		// alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	    }
	  else
	  {
	  document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
		// alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	 }  
	 }
	else if(yy%4!=0 && dd=="28")
	 {
	 
	 if(document.getElementById("month").options[0].value==document.getElementById("monthOut").options[0].value)
		{
		  document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex+1;
		  // alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	     }
	  else
	  {
	  document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
		  // alert(document.getElementById("monthOut").selectedIndex);
	      disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	      document.getElementById("dateOut").value=1;
	  }    
	 }
	 else
	 {
	
	disp_date(document.getElementById("dateOut"),document.getElementById("month"));
	 document.getElementById("dateOut").value=parseInt(document.getElementById("date").value)+1;
	 document.getElementById("monthOut").value=document.getElementById("month").value;
	
	  
	 }
	
	
  }	
	else if(mm=="12" && dd=="31")
	{
	 if(document.getElementById("month").options[0].value==document.getElementById("monthOut").options[0].value)
		{
		 document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex+1;
		 //alert(document.getElementById("monthOut").selectedIndex);
	     disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	     document.getElementById("dateOut").value=1;
	    }
	  else
	    {
	    document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
		 //alert(document.getElementById("monthOut").selectedIndex);
	     disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	     document.getElementById("dateOut").value=1;
	    
	    }    
	}
	
	else
	{
	//alert(parseInt(myscriptTime.getMonth())+1+" "+mm);
	//alert(parseInt(myscriptTime.getFullYear())+1+" "+yy);
	//alert(parseInt(myscriptTime.getDate())-2+" "+dd);
	if(parseInt(myscriptTime.getMonth())+1==mm && parseInt(myscriptTime.getFullYear())==yy)
	{
	//alert("Curr");
	document.getElementById("monthOut").selectedIndex=document.getElementById("month").selectedIndex;
	disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	document.getElementById("dateOut").value=parseInt(document.getElementById("date").value)+1;
		//disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	//dd=parseInt(document.getElementById("date").value)+1;
	}
	
	
	else if(parseInt(myscriptTime.getMonth())+1==mm && parseInt(myscriptTime.getFullYear())+2==yy && dd>parseInt(myscriptTime.getDate())-2)
	{
	//alert("O");
	var mName=getMonthName(mm-1)
	alert("Arrival date should be less than "+parseInt(myscriptTime.getDate()-1)+"-"+mName+"-"+yy);
	document.getElementById("date").value=1;
	return false;

	//disp_date(document.getElementById("dateOut"),document.getElementById("month"));
	}
	else
	{
	document.getElementById("monthOut").value=document.getElementById("month").value;
	disp_date(document.getElementById("dateOut"),document.getElementById("monthOut"));
	document.getElementById("dateOut").value=parseInt(document.getElementById("date").value)+1;
	}
	}
 //alert(DepDate);
 
 } 
 
/* function End_Date(mm,dd,yy)
 {
   var w=
					   {
					  // alert(e);
					   var i=0;
					   ctr.options.length=w	
					   for(i=0;i<w;i++)
					    {
					    ctr.options[i]=new Option(odd[i],i+1);
					    }
					   } 
 
 
 }*/
 
 //alert(navigator.appName);
 
 function ReadHotel(Id)
 {

   if(navigator.appName=="Microsoft Internet Explorer")
    {
      ReadHotelXml1(Id);
    }
    else
    {
       ReadHotelXml(Id)
    }
 }
function ReadHotelXml(Id)
 {
     var XmlHTTP = null;
    var Possibles = {0: "XMLHttpRequest()", 1: "ActiveXObject('Microsoft.XMLHttp')", 2:"ActiveXObject('MSXML2.XMLHttp')", 3:"ActiveXObject('MSXML2.XMLHttp.3.0')", 4:"ActiveXObject('MSXML2.XMLHttp.4.0')", 5:"ActiveXObject('MSXML2.XMLHttp.5.0')", 6:"ActiveXObject('MSXML2.XMLHttp.6.0')",7:"ActiveXObject('Msxml.DOMDocument')", 8:""};
    var Option = 0;
    while(XmlHTTP === null){
        XmlHTTP = eval("new " + Possibles[Option]);
       
    }
if(XmlHTTP === null)
    return false;
XmlHTTP.open("get", "Common_Inc/link.xml", false);
XmlHTTP.send("");
LoadXml = XmlHTTP.responseXML;
getCityCountryId(Id);
}
  
function ReadHotelXml1(Id) 
{ 

	if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
	{ 
		LoadXml = new ActiveXObject("Msxml.DOMDocument"); 
		LoadXml.async = false; 
		LoadXml.onreadystatechange = function () 
		{ 
		    if (LoadXml.readyState == 4) getCityCountryId(Id); 
		} 
		LoadXml.load("Common_Inc/link.xml"); 
	} 
	else if( document.implementation && document.implementation.createDocument ) 
	{ 
		LoadXml = document.implementation.createDocument("","",null); 
		LoadXml.async=false; 
		var loaded = LoadXml.load("Common_Inc/link.xml"); 
		moz=1;
		if (loaded) 
		{ 
			getCityCountryId(Id);
		} 
	} 
	else 
	{ 
		alert("Your browser can\'t handle this script"); 
		return; 
	} 
}
 
 
 
 
 
  
/*function ReadHotelXml(Id) 
{ 

	if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
	{ 
		LoadXml = new ActiveXObject("Msxml.DOMDocument"); 
		LoadXml.async = false; 
		LoadXml.onreadystatechange = function () 
		{ 
		    if (LoadXml.readyState == 4) getCityCountryId(Id); 
		} 
		LoadXml.load("../../Common_Inc/link.xml"); ; 
	} 
	else if( document.implementation && document.implementation.createDocument ) 
	{ 
		LoadXml = document.implementation.createDocument("","",null); 
		LoadXml.async=false; 
		var loaded = LoadXml.load("../../Common_Inc/link.xml"); 
		moz=1;
		if (loaded) 
		{ 
			getCityCountryId(Id);
		} 
	} 
	else 
	{ 
		alert("Your browser can\'t handle this script"); 
		return; 
	} 
}*/
function showcorporate(ctrname)
 {
   PopupWindow_showPopup(ctrname,'corporate');
   
   document.getElementById('child').style.display="none";
   hidebarbooker();
   
 }




function showchild(ctrname)
{
var strroom;
var strnoofchildren;
var posi;
if(navigator.userAgent.indexOf("Safari")!=-1)
posi=3;
else if(navigator.userAgent.indexOf("Firefox")!=-1)
posi=1;
else
posi=1;

 document.getElementById('child').style.display='none';
PopupWindow_showPopup(ctrname,'child');
document.getElementById('corporate').style.display='none';
document.getElementById('cntchildren').innerHTML="";
var gusetroom=document.getElementById("Guests");
document.getElementById("agechild").innerHTML="";
var roomcount=1;//document.getElementById("cmbRoomcount");
  if(gusetroom.value!=5 && gusetroom.value!=-1)
  {
  hidebarbooker();
     document.getElementById('child').style.display='block';
    var child=null;
     if(gusetroom.value<4)
     child=2;
     else
     child=totalguest-gusetroom.value;
     for(j=0;j<=child;j++)
     {
     if(strnoofchildren==null)
     strnoofchildren="<option value='"+j+"'>"+j+"</option>";
     else
     strnoofchildren+="<option value='"+j+"'>"+j+"</option>";
     }
     for(i=1;i<=1;i++)
     {
     if(strroom==null)
     strroom="<table width='250px' cellpadding='1' cellspacing='1' border='0'><tr vAlign='top'><td  class='Booking-Engine-Kids-Label' style='height:23px;width:60px;vertical-align:top;text-align:left;'>Children</td><td style='width:40px;height:20px;vertical-align:top;padding-top:"+posi+"px;'><select id='cmbchildcnt"+i+"' name='cmbchildcnt'"+i+" onchange=showAge('age"+i+"',cmbchildcnt"+i+"); class='Booker-Description' style='width:40px;height:20px;'>"+strnoofchildren+"</select></td><td style='vertical-align:top;text-align:left;width:120px;' id='age"+i+"'></td></tr>";
     else
     strroom+="<tr vAlign='top'><td class='Booking-Engine-Kids-Label' style='height:23px;width:60px;vertical-align:top;text-align:left;'>Children</td><td style='width:40px;height:20px;vertical-align:top;padding-top:"+posi+"px;'><select id='cmbchildcnt"+i+"' name='cmbchildcnt"+i+"' onchange=showAge('age"+i+"',cmbchildcnt"+i+"); class='Booker-Description' style='width:40px;height:20px;vertical-align:top;'>"+strnoofchildren+"</select></td><td id='age"+i+"' width='120px' align='left'></td></tr>";
     }
     strroom+="<tr><td colspan='3' style='text-align:left;'><a href='javascript:hidPopup();' onmouseover=changechdSaveover(document.getElementById('btnHide')); onmouseout=changechdSaveout(document.getElementById('btnHide'));><img border='0' src='images/save.gif' id='btnHide' name='btnHide'/></a></td></tr></table>";
     if(document.getElementById('cntchildren')!=null)
      {
        document.getElementById('cntchildren').innerHTML=strroom;//"<select id='cmbchildcnt' name='cmbchildcnt'><option value='0'>0</option><option value='1'>1</option></select>";
      }  
  }
 else
 {
  showbarbooker();
 document.getElementById('child').style.display='none';
 document.getElementById('cntchildren').innerHTML="";
 }
}
//Function to Display Children Age ComboBox
function showAge(tdid1,childcnt)
{

var tdid=document.getElementById(tdid1);
tdid.innerHTML="";

var strage='';
var strrooms;
if(childcnt.value!=0)
  {
  
    //alert(childcnt.value);
        document.getElementById("tdchild").colspan=1;
     document.getElementById("tdchild").width="50%";
     document.getElementById("agechild").innerHTML="Age of Children";
     for(m=0;m<=16;m++)
     {
     if(strrooms==null)
     strrooms="<option value='<1'><1</option>";
     else
     strrooms+="<option value='"+m+"'>"+m+"</option>";
     }
    var t=0;
     strage+="<table cellpadding='0' cellspacing='0' border='0'>"
    strage+="<tr vAlign='top'>"
     for(k=0;k<childcnt.value;k++)
     {
      strage+="<td align='left' style='padding-bottom:1px;'>";
      if(t!=0)
      if(t%2==0)
      strage+="<tr vAlign='top'><td style='padding-top:1px;' align='left'>"
      if(strage==null)
      strage="<select id='childage"+childcnt.name+k+"' name='childage"+childcnt.name+k+"' class='Booking-Engine-Kids-Description' style='width:45px'>"+strrooms+"</select>";
      else
      strage+="&nbsp<select id='childage"+childcnt.name+k+"' name='childage"+childcnt.name+k+"' class='Booking-Engine-Kids-Description' style='width:45px'>"+strrooms+"</select>";
        strage+="</td>";
        t++;
     }
      strage+="</tr></table>"
    tdid.innerHTML=strage;
    strage=null;
   
    //alert("SD");
  }
else
 {

 if(document.getElementById("childagecmbchildcnt0")==null && document.getElementById("childagecmbchildcnt1")==null && document.getElementById("childagecmbchildcnt10")==null && document.getElementById("childagecmbchildcnt11")==null && document.getElementById("childagecmbchildcnt20")==null && document.getElementById("childagecmbchildcnt21")==null && document.getElementById("childagecmbchildcnt30")==null && document.getElementById("childagecmbchildcnt31")==null && document.getElementById("childagecmbchildcnt40")==null && document.getElementById("childagecmbchildcnt41")==null)
 {
    document.getElementById("tdchild").colspan=2;
     document.getElementById("tdchild").width="100%";
    document.getElementById("agechild").innerHTML="";
 }
     //document.getElementById("tdid").innerHTML="";
     strage=null;
      tdid.innerHTML="";
 }

}
//Function to design a Quick Booker for safari browser
function Dynamicdesignsafari()
{

var strTitle


var design="<table width='957px' height='42'  border='0' bordercolor='#00000' cellpadding='0' cellspacing='0'>";
design+="<tr><td width='13px' rowspan='2'>&nbsp;</td>";
design+="<td  style='width:262px;height:10px;padding-top:3px;text-align:left;' class='Booker-Label'>Destination</td><td width='88' height='10' style='padding-top:3px;' class='Booker-Label'>Arrival Date</td><td width='47' height='10' class='Booker-Label'>&nbsp;</td> <td width='25' height='10' class='Booker-Label'>&nbsp;</td>"
design+="<td class='Booker-Label' style='width:88px;height:10px;text-align:left;padding-top:3px;'>Departure Date</td><td width='47' height='10' class='Booker-Label'>&nbsp;</td><td width='25' height='10' class='Booker-Label'>&nbsp;</td>";
//design+="<td class='Booker-Label' style='width:44px;height:10px;text-align:left;padding-top:3px;'>Rooms</td>";
design+="<td class='Booker-Label' style='width:70px;height:10px;text-align:left;padding-top:3px;'>Adults</td>";
//design+="<td width='46' height='19' class='booker-menu'></td>";

design+="<td rowspan='2'class='Booker-Label' style='width:170px;height:10px;text-align:left;padding-right:5px;padding-top:11px;'><div class='Booker-Description-Link' style='width:153px;height:16px;vertical-align:middle;' id='dispd'><a href=javascript:showcorporate('dispd'); id='anccorp' name='anccorp' class='booker-email-links'>+&nbsp;Have a Corporate Code?</a></div></td>"
design+="<td rowspan='2' class='Booker-Label' style='width:76px;height:10px;text-align:left;padding-top:12px;'><a href='#' onclick='javascript:return opentrust();'><img border='0' id='btnFindroom' name='btnFindroom' src='images/findroom.gif' onmouseover=changeFindover(document.getElementById('btnFindroom')); onmouseout=changeFindout(document.getElementById('btnFindroom'));></a></td>"
design+="<td class='Booker-Label' style='width:24px;height:10px;text-align:left;'></td>"
design+="</tr><tr>";
design+="<input type='hidden' name=language id=language value=en><input type='hidden' name='ccpSelectCountry' id='ccpSelectCountry'><input type='hidden' name='ccpSelectCity' id='ccpSelectCity'><input type='hidden' name='ccpSelectHotel' id='ccpSelectHotel'><input type='hidden' name='calArrivalDateField' id='calArrivalDateField'><input type='hidden' name='calDepartureDateField' id='calDepartureDateField'><input type='hidden' name=prsRoomCount id=prsRoomCount value=3><input type='hidden'name='occupancy' id='occupancy'><input type='hidden' name=prsRoomCount id=prsRoomCount>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='cmdCityhotel' name='cmdCityhotel' class='Booker-Description-NonInitcap' style='width:256px'></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='month' name='month' onchange=disp_date(document.getElementById('date'),document.getElementById('month')),changeDate(); class='Booker-Description' style='width:84px'><option value='0'>Select a Month</option></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='date' name='date' onchange='changeDate()' class='Booker-Description' style='width:43px'><option value=''></option></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><img id='indate' name='indate' src='images/calendar.jpg' onclick='invokeCal(ci);' onmouseover='setcType();' onmouseout='setcType();'></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='monthOut' name='monthOut' onchange=disp_date(document.getElementById('dateOut'),document.getElementById('monthOut')) class='Booker-Description' style='width:84px'><option value='0'>Select a Month</option></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='dateOut' name='dateOut' class='Booker-Description' style='width:43px' onchange='checkdate();'><option value=''></option></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><img id='outdate' src='images/calendar.jpg' onclick='invokeCal(co);' name='outdate' onmouseover='setcType();' onmouseout='setcType();'></td>";
//design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='cmbRoomcount' name='cmbRoomcount' onchange=showchild('Guests'); class='Booker-Description' style='width:40px'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option></select></td>";
design+="<td height='20' style='text-align:left;vertical-align:top;'><select id='Guests' name='guests' onchange=showchild('Guests'); class='Booker-Description' style='width:60px'><option value='-1'>Select</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select></td>"
//design+="<td height='20' style='text-align:left;vertical-align:top;padding-right:5px;'></td>";
//design+="<td height='20' style='text-align:left;vertical-align:top;'></td>"
design+="<td><DIV ID='child' class='children'>";
design+="<table border='0' class='Booker-border' width='275px'><tr><td><table width='270px' border='0'><tr><td colspan='2' class='booker-menumiddle'><div style='font-size:smaller;font-weight:normal;'>Please  specify  the  number  and  age  of  children  staying  in  each  room</div></td><td vAlign='top'><a href='javascript:ClosePopup();'><img border='0' id='close' name='close' src='Images/closebtn_icon.jpg'/></a></td></tr><tr><td colspan='3'></td><tr><td id='tdchild' name='tdchild' style='width:40%' class='Booking-Engine-Kids-Label'  style='text-align:left;height:22px;padding-left:6px;'><div style='vertical-align:bottom;'></div></td><td id='agechild' class='Booking-Engine-Kids-Label' style='width:60%;text-align:left;padding-left:40px;'></td></tr>";
design+="<tr><td style='vertical-align:top;width:100%;' colspan='3' id='cntchildren' name='cntchildren'></td></tr></table></td></tr></table>"
design+="</DIV>";
design+="<DIV ID='corporate' class='corporate'>";
design+="<table width='200px' class='Booker-border'>";
design+="<tr><td align='right'><a href='javascript:ClosecorpPopup();'><img border='0' id='closeiata' name='closeiata' src='images/closebtn_icon.jpg'/></a></td></tr>";
design+="<tr><td><table width='180px' cellpadding='3' border='0'>";
design+="<tr><td width='100%' align='left' class='Booker-Label'>Corporate ID/IATA Number:</td></tr>";
design+="<tr><td width='100%' align='left'><input type='text' id='iata' name='iata' maxlength='10'></td></tr>";
design+="<tr><td width='100%' align='left' class='Booker-Label'>Rate Access Code:</td></tr>";
design+="<tr><td width='100%' align='left'><input type='text' id='code' name='code' maxlength='10'></td></tr>";
design+="<tr><td width='100%' align='left'><a href='javascript:hidRatecode();' onmouseover=changecorpSaveover(document.getElementById('codesave')); onmouseout=changecorpSaveout(document.getElementById('codesave'));><img src='images/save.gif' id='codesave' name='codesave' border='0'></a></td></tr>";
design+="</table>";
design+="</td></tr></table>";
design+="<div>";
design+="</td>";
design+="</tr></table>";


document.write(design);




}
//Function to design a Quick Booker for IE and FireFox

function DynamicdesignIEandFireFox()
{
var padleft=null;
var childpadleft=null;
//if(navigator.userAgent.indexOf("Safari")!=-1)
//padleft=3;
if(navigator.userAgent.indexOf("Firefox")!=-1)
{
padleft=49;
childpadleft=5;
}
else
{
padleft=54;
childpadleft=12;
}
var strTitle
var design="<table width='957px' height='35px'  border='0' bordercolor='#00000' cellpadding='0' cellspacing='0'>";
design+="<tr><td width='10px' rowspan='2'>&nbsp;</td>";
design+="<td style='width:270px;height:10px;text-align:left;padding-top:3px;' class='Booker-Label'>Destination</td><td width='75' height='10' class='Booker-Label' style='padding-top:3px;'>Arrival Date</td><td width='40' height='10' class='Booker-Label'>&nbsp;</td> <td width='34' height='10' class='Booker-Label'>&nbsp;</td>"
design+="<td class='Booker-Label' style='width:115px;height:5px;text-align:left;padding-top:3px;' colspan='2'>Departure Date</td><td width='34' height='10' class='Booker-Label'>&nbsp;</td>";
//design+="<td class='Booker-Label' style='width:44px;height:5px;text-align:left;padding-top:3px;'>Rooms</td>";
design+="<td class='Booker-Label' style='width:70px;height:5px;text-align:left;padding-top:3px;'>Adults</td>";
//design+="<td width='46' height='19' class='booker-menu'></td>";

design+="<td rowspan='2' class='Booker-Label' style='width:175px;height:20px;text-align:center;padding-top:8px;padding-right:7px;'><div class='Booker-Description-Link' style='width:143px;height:16px;' id='dispd'><a href=javascript:showcorporate('dispd'); id='anccorp' name='anccorp' class='booker-email-links'>+&nbsp;Have a Corporate Code?</a></div></td>"
design+="<td rowspan='2' class='Booker-Label' style='width:86px;height:10px;text-align:left;padding-top:14px;vertical-align:top;'><a href='#' onclick='javascript:return opentrust();'><img border='0' id='btnFindroom' name='btnFindroom' src='images/findroom.gif' onmouseover=changeFindover(document.getElementById('btnFindroom')); onmouseout=changeFindout(document.getElementById('btnFindroom'));></a></td>"
design+="<td class='Booker-Label' style='width:4px;height:20px;text-align:left;' rowspan='2'>&nbsp;</td>"
design+="</tr><tr height='25px'>";
design+="<input type='hidden' name=language id=language value=en><input type='hidden' name='ccpSelectCountry' id='ccpSelectCountry'><input type='hidden' name='ccpSelectCity' id='ccpSelectCity'><input type='hidden' name='ccpSelectHotel' id='ccpSelectHotel'><input type='hidden' name='calArrivalDateField' id='calArrivalDateField'><input type='hidden' name='calDepartureDateField' id='calDepartureDateField'><input type='hidden' name=prsRoomCount id=prsRoomCount value=3><input type='hidden'name='occupancy' id='occupancy'><input type='hidden' name=prsRoomCount id=prsRoomCount>";
design+="<td  style='text-align:left;vertical-align:top;padding-bottom:3px;height:25px;'><select id='cmdCityhotel' name='cmdCityhotel' class='Booker-Description-NonInitcap' style='width:258px'></select></td>";
design+="<td style='text-align:left;vertical-align:top;height:25px;'><select id='month' name='month' onchange=disp_date(document.getElementById('date'),document.getElementById('month')),changeDate(); class='Booker-Description' style='width:72px'><option value='0'>Select a Month</option></select></td>";
design+="<td  style='text-align:left;vertical-align:top;height:25px;'><select id='date' name='date' onchange='changeDate()' class='Booker-Description' style='width:37px'><option value=''></option></select></td>";
design+="<td style='text-align:left;vertical-align:top;height:25px;'><img id='indate' name='indate' src='images/calendar.jpg' onclick='invokeCal(ci);' onmouseover='setcType();' onmouseout='setcType();'></td>";
design+="<td  style='text-align:left;vertical-align:top;width:75px;height:25px;'><select id='monthOut' name='monthOut' onchange=disp_date(document.getElementById('dateOut'),document.getElementById('monthOut')) class='Booker-Description' style='width:72px'><option value='0'>Select a Month</option></select></td>";
design+="<td style='text-align:left;vertical-align:top;width:40px;height:25px;'><select id='dateOut' name='dateOut' class='Booker-Description' style='width:37px' onchange='checkdate();'><option value=''></option></select></td>";
design+="<td style='text-align:left;vertical-align:top;width:34px;height:25px;'><img id='outdate' src='images/calendar.jpg' onclick='invokeCal(co);' name='outdate' onmouseover='setcType();' onmouseout='setcType();'></td>";
//design+="<td  style='text-align:left;vertical-align:top;height:25px;'><select id='cmbRoomcount' name='cmbRoomcount' onchange=showchild('Guests'); class='Booker-Description' style='width:35px'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option></select></td>";
design+="<td style='text-align:left;vertical-align:top;height:25px;'><select id='Guests' name='guests' onchange=showchild('Guests'); class='Booker-Description' style='width:55px'><option value='-1'>Select</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select></td>"
//design+="<td></td>";
//design+="<td height='25' style='text-align:left;vertical-align:top;'></td>"
design+="<td><DIV ID='child' class='children'>";
design+="<table border='0' class='Booker-border' width='278px' cellpadding='0' cellspacing='0'><tr><td><table width='270px' border='0' cellpadding='4' cellspacing='0'><tr><td colspan='2' class='booker-menumiddle'><div style='font-size:smaller;font-weight:normal;'>Please  specify  the  number  and  age  of  children  staying  in  each  room</div></td><td vAlign='top'><a href='javascript:ClosePopup();'><img border='0' id='close' name='close' src='images/closebtn_icon.jpg'/></a></td></tr><tr><td colspan='3'></td></tr><tr><td id='tdchild' name='tdchild' class='Booking-Engine-Kids-Label'  style='text-align:left;height:22px;padding-left:"+childpadleft+"px;width:30%'><div style='vertical-align:bottom;'></div></td><td id='agechild' class='Booking-Engine-Kids-Label' style='width:70%;text-align:left;padding-left:"+padleft+"px;'></td></tr>";
design+="<tr><td style='vertical-align:top;width:100%;' colspan='3' id='cntchildren' name='cntchildren'></td></tr></table></td></tr></table>"
design+="</DIV>";
design+="<DIV ID='corporate' class='corporate'>";
design+="<table width='200px' class='Booker-border'>";
design+="<tr><td align='right'><a href='javascript:ClosecorpPopup();'><img border='0' id='closeiata' name='closeiata' src='Images/closebtn_icon.jpg'/></a></td></tr>";
design+="<tr><td><table width='180px' cellpadding='3' border='0'>";
design+="<tr><td width='100%' align='left' class='Booker-Label'>Corporate ID/IATA Number:</td></tr>";
design+="<tr><td width='100%' align='left'><input type='text' id='iata' name='iata' maxlength='10'></td></tr>";
design+="<tr><td width='100%' align='left' class='Booker-Label'>Rate Access Code:</td></tr>";
design+="<tr><td width='100%' align='left'><input type='text' id='code' name='code' maxlength='10'></td></tr>";
design+="<tr><td width='100%' align='left'><a href='javascript:hidRatecode();' onmouseover=changecorpSaveover(document.getElementById('codesave')); onmouseout=changecorpSaveout(document.getElementById('codesave'));><img src='images/save.gif' id='codesave' name='codesave' border='0'></a></td></tr>";
design+="</table>";
design+="</td></tr></table>";
design+="<div>";
design+="</td>";
design+="</tr></table>";


document.write(design);




}


//To Get City and Country Ids
function getCityCountryId(resortid)
{

var j=0;
strTitle = LoadXml.getElementsByTagName("HotelLinks")[0]; 
var cap;
var lnk

if(strTitle.getElementsByTagName('Hotel').length>0)
{

for(var i=0; i<strTitle.getElementsByTagName('Hotel').length; i++) 
{
if(strTitle.getElementsByTagName('Hotel')[i].getAttribute("HotelId")==resortid)
{
var countId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("countryId");
var cityId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("CityId");
}
} 

}
document.getElementById('ccpSelectCountry').value=countId;
document.getElementById('ccpSelectCity').value=cityId;



}

            
function ReadTrustXml() 
{ 

	if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
	{ 
		LoadTrustXml = new ActiveXObject("Msxml.DOMDocument"); 
		LoadTrustXml.async = false; 
		LoadTrustXml.onreadystatechange = function () 
		{ 
		    if (LoadTrustXml.readyState == 4) 
		    {
		    if(IsEnable()) 
		   window.location.href="https://www.trustinternational.com/mBooker/taj/4Z?LANGUAGE=en_US&property_selection=TXL-TJ-HL"+Id+"&in_day="+document.getElementById("date").value+"&in_month="+(parseInt(ArArr[0])+1)+"-"+ArArr[1]+"&out_day="+document.getElementById("dateOut").value +"&out_month="+(parseInt(DpArr[0])+1)+"-"+DpArr[1]+"&guests="+document.f1.Guests.value+"&iata="+document.f1.iata.value+"&rate_access_code="+document.f1.accessCode.value;
		    else
		   window.location.href="../../TajHotelFinder/WebForm1.aspx?HotelID=HL"+Id+"&in_Day="+document.getElementById("date").value+"&in_month="+document.getElementById("month").value+"&out_day="+document.getElementById("dateOut").value+"&out_month="+document.getElementById("monthOut").value+"&guest="+document.f1.Guests.value;
		    }
		    
		} 
		LoadTrustXml.load("../../Common_Inc/TrustEnable.xml"); 
	} 
	else if(document.implementation && document.implementation.createDocument) 
	{ 
	
		LoadTrustXml = document.implementation.createDocument("","",null); 
		LoadTrustXml.async=false; 
		var loaded = LoadTrustXml.load("../../Common_Inc/TrustEnable.xml"); 
		moz=1;
		if (loaded) 
		{ 
			if(IsEnable()) 
		    window.location.href="https://www.trustinternational.com/mBooker/taj/4Z?LANGUAGE=en_US&property_selection=TXL-TJ-HL"+Id+"&in_day="+document.getElementById("date").value+"&in_month="+(parseInt(ArArr[0])+1)+"-"+ArArr[1]+"&out_day="+document.getElementById("dateOut").value +"&out_month="+(parseInt(DpArr[0])+1)+"-"+DpArr[1]+"&guests="+document.f1.Guests.value+"&IATA="+document.f1.iata.value+"&rate_access_code="+document.f1.accessCode.value;
		    else
		   window.location.href="../../TajHotelFinder/WebForm1.aspx?HotelID=HL"+Id+"&in_Day="+document.getElementById("date").value+"&in_month="+document.getElementById("month").value+"&out_day="+document.getElementById("dateOut").value+"&out_month="+document.getElementById("monthOut").value+"&guest="+document.f1.Guests.value;
		} 
	} 
	else 
	{ 
		alert("Your browser can\'t handle this script"); 
		return; 
	} 
}



function IsEnable()
{
var strTitle
var j=0;

strTitle = LoadTrustXml.getElementsByTagName("Trust")[0]; 
 if(strTitle.getElementsByTagName("Enable").length>0)
  {
    if(strTitle.getElementsByTagName("Enable")[0].firstChild.nodeValue==1)
    {
      return true;
    }
    else
    {
    return false;
    }
  } 

 }



   

            
	 
 function openpopup(filename,wd,ht,top,lft)
{
//var filename="summer_experience.htm";
var Offerwin;
if(filename!="" ||filename!=null)
Offerwin=window.open(filename,"offer","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+wd+",height="+ht+",top="+top+",left="+lft);
Offerwin.focus();


}

function offerLink_fn1()
{
var countId;
 var cityId
 var strTitle;

strTitle = LoadXml.getElementsByTagName("HotelLinks")[0]; 
  if(strTitle.getElementsByTagName('Hotel').length>0) 
   { 
     for(var i=0; i<strTitle.getElementsByTagName('Hotel').length; i++) 
      {
        if(strTitle.getElementsByTagName('Hotel')[i].getAttribute("HotelId")==Id)
           {
                    countId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("countryId");
                    cityId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("CityId");
                    break;
            }        
                    
       }
//document.location.href = "https://www.trustinternational.com/mBooker/taj/2B?LANGUAGE=en&i=TajHolidays&property=TXL-TJ-"+Id;
   }
  document.location.href="https://www.yourreservation.net/ibe/TajHolidays/main.html?ccpSelectCity=" +cityId +"&ccpSelectCountry="+countId+"&ccpSelectHotel=TJ%2D"+Id+"&language=EN&quick=page1" 
 }  


function getAnchorWindowPosition(anchorname) {


	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}
	
	function PopupWindow_showPopup(anchorname,divname) {

	var coordinates;
	//coordinates=getAnchorPosition(anchorname);
	coordinates=PopupWindow_getXYPosition(anchorname);
	
	//coordinates.x += this.offsetX;
	//coordinates.y += this.offsetY;
	if (document.getElementById(divname) != null) {
		// Show the DIV object
			document.getElementById(divname).style.left = coordinates.x +"px";
			document.getElementById(divname).style.top = coordinates.y +24+"px";
			document.getElementById(divname).style.display = "block";
			}
			
			
		
	}
	
	
	function PopupWindow_getXYPosition(anchorname) {
	var coordinates;
	if (this.type == "WINDOW") {
		coordinates = getAnchorWindowPosition(anchorname);
		}
	else {
		coordinates = getAnchorPosition(anchorname);
		}
	return coordinates;
	}
	
	
	function getAnchorPosition(anchorname) {

	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}
	
	
	
	
	function AnchorPosition_getPageOffsetLeft (el) {
	
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}
	
function hidPopup()
{
document.getElementById('child').style.display='none';
showbarbooker();
}	
function getId()
{
alert(document.getElementById('cmdCityhotel').options[document.getElementById('cmdCityhotel').selectedIndex].value);
}	

function hidRatecode()
{
  document.getElementById('corporate').style.display='none';
  if(document.getElementById('iata').value!='' || document.getElementById('code').value!='')
  document.getElementById('anccorp').innerHTML='Edit/Remove Corporate Code';
  else
  document.getElementById('anccorp').innerHTML='+&nbsp;Have a Corporate Code?';
  showbarbooker();
  
 
}

function ClosePopup()
{
document.getElementById('child').style.display='none';
showbarbooker();

}


//--------------------------------------
//Code to Fill City,Hotel combBox From Xml File
function ReadHotelDetails(Id)
 {
   if(navigator.appName=="Microsoft Internet Explorer")
    {
      ReadHotelDetailsXml1(Id);
    }
    else
    {
       ReadHotelDetailsXml(Id)
    }
 }
function ReadHotelDetailsXml(Id)
 {
     var XmlHTTP = null;
    var Possibles = {0: "XMLHttpRequest()", 1: "ActiveXObject('Microsoft.XMLHttp')", 2:"ActiveXObject('MSXML2.XMLHttp')", 3:"ActiveXObject('MSXML2.XMLHttp.3.0')", 4:"ActiveXObject('MSXML2.XMLHttp.4.0')", 5:"ActiveXObject('MSXML2.XMLHttp.5.0')", 6:"ActiveXObject('MSXML2.XMLHttp.6.0')",7:"ActiveXObject('Msxml.DOMDocument')", 8:""};
    var Option = 0;
    while(XmlHTTP === null){
        XmlHTTP = eval("new " + Possibles[Option]);
       
    }
if(XmlHTTP === null)
    return false;
XmlHTTP.open("get", "Common_Inc/Hotel.xml", false);
XmlHTTP.send("");
LoadHotelDetailsXml = XmlHTTP.responseXML;
FillHotelCombo(Id);
}
  
function ReadHotelDetailsXml1(Id) 
{ 

	if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
	{ 
		LoadHotelDetailsXml = new ActiveXObject("Msxml.DOMDocument"); 
		LoadHotelDetailsXml.async = false; 
		LoadHotelDetailsXml.onreadystatechange = function () 
		{ 
		    if (LoadHotelDetailsXml.readyState == 4) FillHotelCombo(Id); 
		} 
		LoadHotelDetailsXml.load("Common_Inc/Hotel.xml"); 
	} 
	else if( document.implementation && document.implementation.createDocument ) 
	{ 
		LoadHotelDetailsXml = document.implementation.createDocument("","",null); 
		LoadHotelDetailsXml.async=false; 
		var loaded = LoadHotelDetailsXml.load("Common_Inc/Hotel.xml"); 
		moz=1;
		if (loaded) 
		{ 
			FillHotelCombo(Id);
		} 
	} 
	else 
	{ 
		alert("Your browser can\'t handle this script"); 
		return; 
	} 
}

function FillHotelCombo(ResortID)
{

var cmb=document.getElementById('cmdCityhotel');
cmb.options[0]=new Option("--Select a Destination--","-1");
var j=0;
var strHotel;
strHotel = LoadHotelDetailsXml.getElementsByTagName("HotelDetails")[0]; 
if(strHotel.getElementsByTagName('Hotel').length>0)
{

for(var i=0; i<strHotel.getElementsByTagName('Hotel').length; i++) 
{
 
        var City=strHotel.getElementsByTagName('Hotel')[i].getAttribute("City");
        var Country=strHotel.getElementsByTagName('Hotel')[i].getAttribute("Country");
        var HotelName=strHotel.getElementsByTagName('Hotel')[i].getAttribute("HotelName");
        var HtlID=strHotel.getElementsByTagName('Hotel')[i].getAttribute("HotelID");
        cmb.options[i+1]=new Option(HotelName,HtlID);
         if(HtlID==ResortID)
  cmb.options[i+1].selected=true;
   
} 

}

}
//-----------------------------------------

function checkdate()
{
   var outmonth=document.getElementById("monthOut");
   var outdate=document.getElementById("dateOut");
   //alert(outmonth.options[outmonth.selectedIndex].value);
  //alert(outdate.options[outdate.selectedIndex].value);
   var otmonth=outmonth.options[outmonth.selectedIndex].value;
   var otdate=outdate.options[outdate.selectedIndex].value;
   var chkout=new Array();
   chkout=otmonth.split(':');
   var Out=new Date(chkout[1],chkout[0],otdate);
  // alert(Out)
    /*var mNum=getMonthNumber(mm.toUpperCase());*/
    
    var cOut=new Date(myscriptTime.getFullYear()+2,myscriptTime.getMonth(),myscriptTime.getDate()-1);
   // alert(cOut);
	if(Out>cOut)
            {
            alert("Departure date should be less than  "+ (parseInt(cOut.getDate())+1)+"-"+getMonthName(cOut.getMonth())+"-"+cOut.getFullYear());
             outdate.value=myscriptTime.getDate()-1;
              document.getElementById("dateOut").focus();
            return false;
           
           
            }
}

function ClosecorpPopup()
{
if(document.getElementById('corporate')!=null)
 document.getElementById('corporate').style.display='none';
showbarbooker();
 
}

function changeFindover(btn)
{

btn.src='images/findroom_over.gif';
}
function changeFindout(btn)
{
btn.src='images/findroom.gif';
}

function changechdSaveover(btn)
{

btn.src='images/save_over.gif';
}
function changechdSaveout(btn)
{
btn.src='images/save.gif';
}

function changecorpSaveover(btn)
{

btn.src='images/save_over.gif';
}
function changecorpSaveout(btn)
{
btn.src='images/save.gif';
}



function Closebookerdivs()
{
if(document.getElementById('child')!=null)
 document.getElementById('child').style.display='none';
if(document.getElementById('corporate')!=null)
 document.getElementById('corporate').style.display='none';
 showbarbooker();
}

function hidebarbooker()
{
if(document.getElementById('divd')!=null)
document.getElementById('divd').style.visibility='hidden';
}
function showbarbooker()
{
//alert(document.getElementById("viewButton").src.indexOf("image-animation_files/viewfullimage.jpg"));
if(document.getElementById('image')!=null)
{
    if(document.getElementById('divd')!=null)
    {
    //alert(fl);
        if(document.getElementById("viewButton").src.indexOf("image-animation_files/viewfullimage.jpg")!=-1)
        document.getElementById('divd').style.visibility='visible';
    }    
}
}


function clockon() {

 //thistime= new Date()
 timeobj.setSeconds(timeobj.getSeconds()+1)
 //alert(timeobj.setSeconds(timeobj.getSeconds()+1));
 var hours=timeobj.getHours()
 var minutes=timeobj.getMinutes()
 var seconds=timeobj.getSeconds()
 if (eval(hours) <10) {hours="0"+hours}
 if (eval(minutes) < 10) {minutes="0"+minutes}
 if (seconds < 10) {seconds="0"+seconds}
 var thistime1 ="<span class='km-txt'>Local Time:"+hours+":"+minutes+":"+ seconds+"</span>";
 if(document.getElementById('clockdiv')!=null)
 document.getElementById('clockdiv').innerHTML=thistime1
 var timer=setTimeout("clockon()",1000)
}

function querySth(ji)
 {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (p=0;p<gy.length;p++)
    {
        ft = gy[p].split("=");
            if (ft[0] == ji) 
            {
                return ft[1];
            }
    }
 }   
 
 
 
 
 
 
 
 
 
 
 function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}