    // Set the date dropdowns
    // dayoffset is the number of days in the future that we want to
    // prepopulate the arrival form with (0 = today, 1 = tomorrow etc)
    // nights is the number of days difference between arrival and departure prepopulated
	function setDate(dayoffset,nights) {
		if(document.getElementById("Arrival_day")) {
			var now = new Date();

			var arrival = new Date(now.getTime()+(dayoffset*(86400*1000)));
			document.getElementById("Arrival_day").selectedIndex = arrival.getDate()-1;
			setYM('Arrival_yearmonth', arrival);

			if (nights < 1) {
			nights = 1;
			}
			var departure = new Date(arrival.getTime()+(nights*(86401*1000)));
			document.getElementById("Departure_day").selectedIndex = departure.getDate()-1;
			setYM('Departure_yearmonth', departure);
		}
	}
    // Populate the combined year/month drop down boxes
    // for one year starting with the current month
    function setYM(element, myDate) {
        // var myDate = new Date();

        var cur_month	= myDate.getMonth();
        var cur_year		= myDate.getFullYear();
        var month=cur_month;

        var _month = new Array();
        _month[0] = "Jan";
        _month[1] = "Feb";
        _month[2] = "Mar";
        _month[3] = "Apr";
        _month[4] = "May";
        _month[5] = "Jun";
        _month[6] = "Jul";
        _month[7] = "Aug";
        _month[8] = "Sep";
        _month[9] = "Oct";
        _month[10] = "Nov";
        _month[11] = "Dec";


       	for (i=0;i<12;i++){
       	  if (cur_month < 9) {
            month = '0'+(cur_month+1);
          } else {
            month = (cur_month+1);
          }
          document.getElementById(element).options[i] = new Option(_month[cur_month]+' '+cur_year,cur_year+''+month);
          if (cur_month == 11) {
            cur_month = 0;
            cur_year += 1;
          } else {
            cur_month++;
          }
        }
    }
