function sendArrivalDate(day, month1, year, currentMonth)
{
	var theday = parseInt(day);
	var themonth = parseInt(month1);
	var theyear = parseInt(year);
	var thecurrentmonth = parseInt(currentMonth);
	
	var monthText = new Array();
	var month = new Array();
	
	monthText[1] = "Jan";
	month[1] = 31;
	
	monthText[2] = "Feb";
	if(theyear%4 == 0)
	{
		if(theyear%100 != 0)
		{
			month[2] = 29;
		}else
		{
			if(theyear%400 == 0)
			{
				month[2] = 29;
			}else{
				month[2] = 28;
			}
		}
	}else{
		month[2] = 28;
	}
	
	monthText[3] = "Mar";
	month[3] = 31;
	
	monthText[4] = "Apr";
	month[4] = 30;
	
	monthText[5] = "May";
	month[5] = 31;
	
	monthText[6] = "Jun";
	month[6] = 30;
	
	monthText[7] = "Jul";
	month[7] = 31;
	
	monthText[8] = "Aug";
	month[8] = 31;
	
	monthText[9] = "Sep";
	month[9] = 30;
	
	monthText[10] = "Oct";
	month[10] = 31;
	
	monthText[11] = "Nov";
	month[11] = 30;
	
	monthText[12] = "Dec";
	month[12] = 31;
	
	document.getElementById('inmonthyear').options.length=0;
		
	var temp;
	var counter = 0;
	for(i=thecurrentmonth;i<thecurrentmonth+12;i++)
	{
		if(i>12)
		{
			temp = i - 12;
		}else{
			temp = i;
		}
		
		if(themonth == temp)
		{
			document.getElementById('inmonthyear').options[counter]=new Option(monthText[temp] + " " + theyear,theyear + "-" + temp, false, true);
		}else{
			document.getElementById('inmonthyear').options[counter]=new Option(monthText[temp] + " " + theyear,theyear + "-" + temp, false, false);
		}
		counter++;
	}
	
	document.getElementById('inday').options.length=0;
		
	for(i=0;i<month[themonth];i++)
	{
		if(theday == i+1)
		{
			document.getElementById('inday').options[i]=new Option(i+1, i+1, false, true);	
							
		}else{
			document.getElementById('inday').options[i]=new Option(i+1, i+1, false, false);
		}
	}
	
	var hidemonth = 'calendarContainer';

	hide = document.getElementById(hidemonth);
	hide.style.display = "none";

}



function sendDepartureDate(day, month1, year, currentMonth)
{
	var theday = parseInt(day);
	var themonth = parseInt(month1);
	var theyear = parseInt(year);
	var thecurrentmonth = parseInt(currentMonth);
	
	var monthText = new Array();
	var month = new Array();
	
	monthText[1] = "Jan";
	month[1] = 31;
	
	monthText[2] = "Feb";
	if(theyear%4 == 0)
	{
		if(theyear%100 != 0)
		{
			month[2] = 29;
		}else
		{
			if(theyear%400 == 0)
			{
				month[2] = 29;
			}else{
				month[2] = 28;
			}
		}
	}else{
		month[2] = 28;
	}
	
	monthText[3] = "Mar";
	month[3] = 31;
	
	monthText[4] = "Apr";
	month[4] = 30;
	
	monthText[5] = "May";
	month[5] = 31;
	
	monthText[6] = "Jun";
	month[6] = 30;
	
	monthText[7] = "Jul";
	month[7] = 31;
	
	monthText[8] = "Aug";
	month[8] = 31;
	
	monthText[9] = "Sep";
	month[9] = 30;
	
	monthText[10] = "Oct";
	month[10] = 31;
	
	monthText[11] = "Nov";
	month[11] = 30;
	
	monthText[12] = "Dec";
	month[12] = 31;
	
	document.getElementById('outmonthyear').options.length=0;
		
	var temp;
	var counter = 0;
	for(i=thecurrentmonth;i<thecurrentmonth+12;i++)
	{
		if(i>12)
		{
			temp = i - 12;
		}else{
			temp = i;
		}
		
		if(themonth == temp)
		{
			document.getElementById('outmonthyear').options[counter]=new Option(monthText[temp] + " " + theyear,theyear + "-" + temp, false, true);
		}else{
			document.getElementById('outmonthyear').options[counter]=new Option(monthText[temp] + " " + theyear,theyear + "-" + temp, false, false);
		}
		counter++;
	}
	
	document.getElementById('outday').options.length=0;
		
	for(i=0;i<month[themonth];i++)
	{
		if(theday == i+1)
		{
			document.getElementById('outday').options[i]=new Option(i+1, i+1, false, true);	
							
		}else{
			document.getElementById('outday').options[i]=new Option(i+1, i+1, false, false);
		}
	}
	
	var hidemonth = 'departureCalendarContainer';

	hide = document.getElementById(hidemonth);
	hide.style.display = "none";
}