     
  function getDateStrWithDOW() {
	var aMonth = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	var today = new Date();		
	var year = today.getYear();
	if(year<1000) year+=1900;
	var nextday= today.getDate() + 1;	
	var todayStr1 = aMonth[today.getMonth()] + " " + nextday + " , " + year;	
	
	//var todayStr =  today.getDate() + " " + aMonth[today.getMonth()] + " , " + year;
	var todayStr = aMonth[today.getMonth()] + " " + today.getDate() + " , " + year;	
	document.form1.datein.value = todayStr;
	if(document.form1.datein1 != null)
	document.form1.datein1.value = todayStr;
	if(document.form1.datein2 != null)
	document.form1.datein2.value = todayStr1;
}
getDateStrWithDOW();

function LandingReservationUrl(HotelID,Nights,Adults,Childrens)
  {
  var Hotelid=document.getElementById(HotelID);
  var Childerns=document.getElementById(Childrens);
  var Adults=document.getElementById(Adults);
  var Nights=document.getElementById(Nights);  
  var b = document.form1.datein.value;
  var DateArray = new Array();
  DateArray = b.split(' ');
  
  fullMonth = ["January","February","March","April","May","June","July","August","September","October","November","December"];
  
  for(i=0;i<fullMonth.length;i++)
  {
      if(fullMonth[i]==DateArray[0])
      {
        var Month=i+1;
      }
  }
  var promocode = document.getElementById("promocode");
  
  document.form1.method="post";
  //https://reservations.ihotelier.com/istay.cfm?hotelid=15279&languageid=1&DateIn=9%2F6%2F2008&length=1&Adults=1&Children=0&Rooms=1
//  var Url="/ClickReservation/ClickReservation.aspx?HotelID="+Hotelid.value+"&Date="+DateArray[1]+"&Month="+Month+"&Year="+DateArray[3]+"&Length="+Nights.value+"&Adults="+Adults.value+"&Children="+Childerns.value+"&identifier=" + promocode.value;
    var Url="/clickreservation/clickreservation.aspx?hotelid="+Hotelid.value+"&arrive="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&adults="+Adults.value+"&child="+Childerns.value+"&identifier=" + promocode.value+"&length="+Nights.value;
  //document.form1.action= Url;
  window.open(Url);
  //document.form1.target="_blank";
 // document.form1.submit();
  } 






	

function popUp(sURL)
	{
		window.open(sURL,'popup','width=950, height=800, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no')
	}
	
        
        function getIndexLanding(index)
        {
            if(index == 1)
            {
                if(navigator.appName == "Microsoft Internet Explorer")
                {
                    document.getElementById("HotelLandingLeft_tr").style.display="inline";
                    document.getElementById("HotelLandingLeft_trresSubmit").style.display="inline";
                    document.getElementById("HotelLandingLeft_trArrival").style.display="inline";
                     document.getElementById("HotelLandingLeft_trArrival1").style.display="inline";

                    //document.getElementById("HotelLandingLeft_trHotelList1").style.display="inline";
                }
                else
                {
                    document.getElementById("HotelLandingLeft_tr").style.display="table-row";
                    document.getElementById("HotelLandingLeft_trresSubmit").style.display="table-row";
                    document.getElementById("HotelLandingLeft_trArrival").style.display="table-row";
                    document.getElementById("HotelLandingLeft_trArrival1").style.display="table-row";
                    //document.getElementById("HotelLandingLeft_trHotelList1").style.display="table-row";
                }
                document.getElementById("HotelLandingLeft_trSubmit").style.display="none";
                document.getElementById("HotelLandingLeft_trChekin").style.display="none";
                //document.getElementById("HotelLandingLeft_trHotelList").style.display="none";
                document.getElementById("HotelLandingLeft_trNights").style.display="none";
                document.getElementById("HotelLandingLeft_trSpace1").style.display="none";
                document.getElementById("HotelLandingLeft_trSpace2").style.display="none";
            }
            else
            {
                 document.getElementById("HotelLandingLeft_tr").style.display="none";
                 document.getElementById("HotelLandingLeft_trresSubmit").style.display="none";                 
                 document.getElementById("HotelLandingLeft_trArrival").style.display="none";
                 document.getElementById("HotelLandingLeft_trArrival1").style.display="none";
                 //document.getElementById("HotelLandingLeft_trHotelList1").style.display="none";
                 if(navigator.appName == "Microsoft Internet Explorer")
                 {
                     document.getElementById("HotelLandingLeft_trSubmit").style.display="inline";
                     document.getElementById("HotelLandingLeft_trChekin").style.display="inline";
                     //document.getElementById("HotelLandingLeft_trHotelList").style.display="inline";  
                     document.getElementById("HotelLandingLeft_trNights").style.display="inline";  
                     document.getElementById("HotelLandingLeft_trSpace1").style.display="inline";
                    document.getElementById("HotelLandingLeft_trSpace2").style.display="inline";               
                 }
                 else
                 {
                     document.getElementById("HotelLandingLeft_trSubmit").style.display="table-row";
                     document.getElementById("HotelLandingLeft_trChekin").style.display="table-row";  
                     //document.getElementById("HotelLandingLeft_trHotelList").style.display="table-row"; 
                     document.getElementById("HotelLandingLeft_trNights").style.display="table-row";                        
                     document.getElementById("HotelLandingLeft_trSpace1").style.display="table-row";
                    document.getElementById("HotelLandingLeft_trSpace2").style.display="table-row";               
                 }
            }
            
            //alert('You have Selected Index:' + index);
        }
        
function ReservationAirUrl(HotelID1,citycode)
  {
  
//  //var sURL=document.getElementById(sURL);
  var Hotelid1=document.getElementById(HotelID1);
  
//  if(Hotelid1.options[0].selected == true)
//  {
//  alert("Please Select Aqua Property!");
//  return false;
//  }
  var Citycode=document.getElementById(citycode).value;  
  var b = document.form1.datein1.value; 
  var DateArray = new Array();
  DateArray = b.split(' ');  

  fullMonth = ["January","February","March","April","May","June","July","August","September","October","November","December"];  
  for(i=0;i<fullMonth.length;i++)
  {
      if(fullMonth[i]==DateArray[0])
      {      
        var Month=i+1;
      }     
  }
   if(Month == "10" || Month == "11" || Month == "12")
      {
        Month = Month;
      }
      else
      {
        Month = "0" + Month;
      }      
      
      var b1 = document.form1.datein2.value; 
      var DateArray1 = new Array();
      DateArray1 = b1.split(' ');
      
      fullMonth1 = ["January","February","March","April","May","June","July","August","September","October","November","December"];
     
       for(j=0;j<fullMonth.length;j++)
        {
          if(fullMonth[j]==DateArray1[0])
          {     
          
            var Month1=j+1;
          }     
      }
       if(Month1 == "10" || Month1 == "11" || Month1 == "12")
          {
            Month1 = Month1;
          }
          else
          {
            Month1 = "0" + Month1;
          }

     if(b>b1)   
     {  
        alert("Departure Date Should be greater than Arrival Date!");
        return false;
     }

if(Hotelid1.options[0].selected == true)
  {
       var Url="/ClickReservation/ClickReservationph.aspx?DepartureCityCode="+Citycode+"&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];
       
      // var Url= "http://www.pleasantholidays.com/PleasantHolidaysWeb/LinkAction.do?PartnerCode=68967&WebSerialNumber=3157&PackageTypeCode=AH&MainDestinationCode=HAW&DepartureCityCode=" + Citycode + "&AtlasPackageCode=AQUA&ProductCode=PHI&CorporationCode=PTS&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];

  }
  else
 {
        var Url="/ClickReservation/ClickReservationph.aspx?HotelCode=" + Hotelid1.value + "&DepartureCityCode="+Citycode+"&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];
       // var Url="http://www.pleasantholidays.com/PleasantHolidaysWeb/LinkAction.do?PartnerCode=68967&WebSerialNumber=3157&PackageTypeCode=AH&MainDestinationCode=HAW&DestinationCityCode=HNL&DepartureCityCode=" + Citycode +"&AtlasPackageCode=AQUA&HotelCode=" + Hotelid1.value + "&ProductCode=PHI&CorporationCode=PTS&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];
 }
  
  //document.form1.action= Url;
  window.open(Url);
  //document.form1.target="_blank";
 // document.form1.submit();
  }
  
  function LandingReservationAirUrl(HotelID1,citycode)
  {
  var Hotelid1=document.getElementById(HotelID1);
  var Citycode=document.getElementById(citycode).value;  
  var b = document.form1.datein1.value; 
  var DateArray = new Array();
  DateArray = b.split(' ');  
  fullMonth = ["January","February","March","April","May","June","July","August","September","October","November","December"];  
  for(i=0;i<fullMonth.length;i++)
  {
      if(fullMonth[i]==DateArray[0])
      {      
        var Month=i+1;
      }     
  }
   if(Month == "10" || Month == "11" || Month == "12")
      {
        Month = Month;
      }
      else
      {
        Month = "0" + Month;
      }      
      
      var b1 = document.form1.datein2.value; 
      var DateArray1 = new Array();
      DateArray1 = b1.split(' ');
      
      fullMonth1 = ["January","February","March","April","May","June","July","August","September","October","November","December"];
     
       for(j=0;j<fullMonth.length;j++)
        {
          if(fullMonth[j]==DateArray1[0])
          {     
          
            var Month1=j+1;
          }     
      }
       if(Month1 == "10" || Month1 == "11" || Month1 == "12")
          {
            Month1 = Month1;
          }
          else
          {
            Month1 = "0" + Month1;
          }
   
      
        b = new Date(Month + "/" + DateArray[1] + "/" + DateArray[3]);
        b1= new Date(Month1 + "/" + DateArray1[1] + "/" + DateArray1[3]);     
     
     if(b>b1)   
     {  
        alert("Departure Date Should be greater than Arrival Date!");
        return false;
     }


     var Url="/ClickReservation/ClickReservationph.aspx?HotelCode=" + Hotelid1.value + "&DepartureCityCode="+Citycode+"&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];
     // var Url="http://www.pleasantholidays.com/PleasantHolidaysWeb/LinkAction.do?PartnerCode=68967&WebSerialNumber=3157&PackageTypeCode=AH&MainDestinationCode=HAW&DestinationCityCode=HNL&DepartureCityCode=" + Citycode +"&AtlasPackageCode=AQUA&HotelCode=" + Hotelid1.value + "&ProductCode=PHI&CorporationCode=PTS&Booking_DepartureDate="+Month+"/"+DateArray[1]+"/"+DateArray[3]+"&Booking_ReturnDate="+Month1 + "/" + DateArray1[1] + "/" + DateArray1[3];

  
  //document.form1.action= Url;
    window.open(Url);
  //document.form1.target="_blank";
 // document.form1.submit();
  }

function openCalendar(FormElement,FormDate,FormMonth,FormYear){
	var calendarwindow;
	var today = new Date();
	var curmonth = today.getMonth();
	curmonth++;
	var todayStr =  curmonth + "/" + today.getDate() + "/" + today.getFullYear();
	url = "/js/calendar.htm?curntdate=" + todayStr + "&formname=form1&formelement=" + FormElement;
	calendarwindow = window.open(url,"thewindow","toolbar=no,LEFT=200,TOP=200,WIDTH=170,HEIGHT=140,status=no,scrollbars=no,resize=no,menubar=no");
	calendarwindow.focus();
}