function PleaseSpamNotSend(ml) { return 'to:'+ ml + '@'; }
function PleaseSendSpamAway(ml) { return ml + '@'; }
//________________________________________________________________________
function Open_Reservations()
{
window.open("http://www.reservationsicecamels.com/irmnet/res/resmain.aspx?Resort=02","","location=no,left=350,top=200,width=850,height=500,scrollbars,resizable,status")
}
function Open_All_Reservations()
{
window.open("http://www.reservationsicecamels.com/irmnet/res/resmain.aspx?Resort=02","","location=no,left=350,top=200,width=850,height=500,scrollbars,resizable,status")
}
//  IRMPath=%5C%5CFs1%5CRDPNT%5CRDP%5C&IRMResort=03&country=Camel
//  IRMPath=%5C%5CFs1%5CRDPNT%5CRDP%5C&IRMResort=DE&country=Camel
//  OLD_Reservations  http://www.reservationsicecamels.com/irm/RoomType1.asp?IRMPath=%5C%5CFs1%5CRDPNT%5CRDP%5C&IRMResort=03&country=Camel
//  OLD_All_Reservations  http://www.reservationsicecamels.com/irm/Default.asp?IRMPath=%5C%5CFs1%5CRDPNT%5CRDP%5C&IRMResort=03&country=Camel
//________________________________________________________________________
var iNights = parseInt(4);
var msPerDay = 24 * 60 * 60 * 1000;			//MilliSeconds per day
var DaysInMonth = new Array();	//Used To check the arrival date entry
		DaysInMonth[1] = 31;		//Jan
		DaysInMonth[2] = 28;		//Feb - Will dynamically change this based on the year entered
		DaysInMonth[3] = 31;		//Mar
		DaysInMonth[4] = 30;		//Apr
		DaysInMonth[5] = 31;		//May
		DaysInMonth[6] = 30;		//Jun
		DaysInMonth[7] = 31;		//Jul
		DaysInMonth[8] = 31;		//Aug
		DaysInMonth[9] = 30;		//Sep
		DaysInMonth[10] = 31;		//Oct
		DaysInMonth[11] = 30;		//Nov
		DaysInMonth[12] = 31;		//Dec
//________________________________________________________________________
function SetDefault() {
	with (document.frmMain) {
		var dtArrival = new Date();
		ArrMonth.options[dtArrival.getMonth()].selected = true;
		ArrDay.options[dtArrival.getDate()-1].selected = true;
		//alert ("SetArrival " + dtArrival.getMonth());

		// NOTE: the .getYear method returns (Year - 1900), so 2000 is 
		//       returned as "100" in IE.  Netscape returns the year 
		//       2000 as "2000".

		var YearIndex = dtArrival.getFullYear();
		//alert ("1-Year " + YearIndex);
		//alert ("Session Year " + 2009);
		//alert ("Year-System " + 2009);

		if (YearIndex >= 2009) {
			YearIndex -= 2009;			//Netscape
		}  else {
			YearIndex -= 100;			//IE
		};
		
		ArrYear.options[YearIndex].selected = true;
	} //End With
}
//________________________________________________________________________
function SetArrivalDepart()	{
      //-------------------------------
      //This function turns the arrival into a text string to submit and calculates an departure date in a string format to submit.
      //-------------------------------
	//alert("Begin SetArrivalDepart ");

  with (document.frmMain) {

      //Take arrival date and make it a string

      var i_am = document.frmMain.ArrMonth.selectedIndex;  // Which menu item is selected for Month
	//alert("i_am " + i_am);
      var n_am = eval(i_am + 1);                               //Add one to make it the actual number of the Month
      //alert("n_am Month " + n_am);
      
      var t_am = n_am + "";                                //Adding a blank string to ensure it is a text variable
      if (t_am.length == 1)
         {
         t_am = "0" + t_am;                       
         }
      //alert("t_am Month " + t_am);

	var n_ad = document.frmMain.ArrDay.selectedIndex;     // Which menu item is selected for Day
      n_ad = eval(n_ad + 1);                                //Add one to make it the actual number of the Day

      var t_ad = n_ad + "";                                //Adding a blank string to ensure it is a text variable
      if (t_ad.length == 1)
         {
         t_ad = "0" + t_ad;                       
         }
      //alert("t_ad Day " + t_ad);
	
	var n_ay = document.frmMain.ArrYear.selectedIndex;     // Which menu item is selected Year, array number
      //alert("n_ay " + n_ay);
      var t_ay = document.frmMain.ArrYear[n_ay].text;        //Get the text value which is the actual year
      //alert("t_ay Year " + t_ay);

	document.frmMain.Arrival.value = t_am + "/" + t_ad + "/" + t_ay;  //set arrival date string into form
	//alert("Arrival Date " + t_am + "/" + t_ad + "/" + t_ay);
      var dtArrival = new Date(t_ay,i_am,n_ad);

  
		//Set the number of Days in February based on the year, for use later
		if (t_ay % 4 == 0) {
			DaysInMonth[2] = 29;		//Leap Year
			}
		else {
			DaysInMonth[2] = 28;		//Non-Leap Year
                  //alert("not a leap year");
		};

		//alert ("CalcDep: ArrDay " + n_ad);
		//alert ("CalcDep: ArrMonth " + t_am);

		//alert ("CalcDep: Days in Arrival Month " + DaysInMonth[n_am]);

		/******************************************************************/

		iNights = (Nights.selectedIndex) + 1;  //convert the index of Nights into the acutal number of nights.
		//alert("CalcDep: Nights " + iNights + "  Night Index " + Nights.selectedIndex);

		/******************************************************************/
		/*
		Calculate new departure date based on arrival + # Nights
		NOTE: Use .getTime to get the number of milliseconds since 1/1/1970 
		for the Arrival date and then add the number of nights in milliseconds
		and then use .setTime to set the departure date.

		I had to set the hours on the arrival date otherwise under certain 
		circumstances the departure date would get calculated 1 day less.  
		For example if the Arrival date is 10/23/97 and you then set the 
		number of nights to 7, the Departure date would get calculated as 
		10/29/97.
		*/

		dtArrival.setHours(22);
		dtArrival.setMinutes(0);
		dtArrival.setSeconds(0);

            var dtDeparture = new Date();
		dtDeparture.setTime(dtArrival.getTime() + (iNights * msPerDay));
		//alert("CalcDep: Departure " + dtDeparture);
	
		/******************************************************************/
		//Update String date with new departure date
            var n_dm = dtDeparture.getMonth() + 1;
	      var n_dd = dtDeparture.getDate();
	      var n_dy = dtDeparture.getFullYear();

	      //alert("Departure Date " + n_dm + "/" + n_dd + "/" + n_dy);


      //Take departure date and make it a string
     
      var t_dm = n_dm + "";                                //Adding a blank string to ensure it is a text variable
      if (t_dm.length == 1)
         {
         t_dm = "0" + t_dm;                       
         }
      //alert("t_dm Month " + t_dm);

      var t_dd = n_dd + "";                                //Adding a blank string to ensure it is a text variable
      if (t_dd.length == 1)
         {
         t_dd = "0" + t_dd;                       
         }
      //alert("t_dd Day " + t_dd);

	document.frmMain.Departure.value = t_dm + "/" + t_dd + "/" + n_dy;  //set departure date string into form
	//alert("Departure Date " + t_dm + "/" + t_dd + "/" + n_dy);

		
	} //End With
	
    //Submit form
	//frmMain.submit();return false;
      window.open('',"reservations","location=no,left=450,top=200,width=750,height=500,scrollbars,resizable,status");
      frmMain.submit();return false;
}

