
var ddlDate;

function getdates(){ //fills date select boxes on event form

	var arrivalDate = "-- Event Date --";    
	var shortDayName = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var shortMonthName = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	
	var date = new Date();
	var select = ddlDate;
	
	var firstDay = date.getDate();
	if(parseInt(firstDay) < 10) firstDay = "0" + firstDay;
	var firstMonth = date.getMonth() + 1;
	if(parseInt(firstMonth) < 10) firstMonth = "0" + firstMonth;
		
	var firstOption = new Option(arrivalDate);
	firstOption.value = date.getFullYear() + firstMonth + firstDay;
	

	document.writeln("<SELECT name=\"sdate\" id=\"arrivaldates\">");
	
	for(var d=0;d<366;d++){ //1 year ahead?
		var day = date.getDate();
	    if(parseInt(day) < 10) day = "0" + day;
		var month = date.getMonth() + 1;
		if(parseInt(month) < 10) month = "0" + month;
		var option = new Option(shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear());
		option.value = date.getFullYear() + "-" + month + "-" + day;
		
		document.writeln("<OPTION value=" + option.value + ">" + shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear() + "</option>");
		
		date.setDate(date.getDate() + 1);
	}
	
	document.writeln("</SELECT>");
}







function getdates2(){ //fills end date select box

	var arrivalDate = "-- Optional --";    
	var shortDayName = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var shortMonthName = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	
	var date = new Date();
	var select = ddlDate;
	
	var firstDay = date.getDate();
	if(parseInt(firstDay) < 10) firstDay = "0" + firstDay;
	var firstMonth = date.getMonth() + 1;
	if(parseInt(firstMonth) < 10) firstMonth = "0" + firstMonth;
		
	var firstOption = new Option(arrivalDate);
	firstOption.value = date.getFullYear() + firstMonth + firstDay;
	

	document.writeln("<SELECT name=\"edate\" id=\"arrivaldates\">");
	
	document.writeln("<OPTION value=\"optional\">Optional</option>");
	
	for(var d=0;d<366;d++){ //1 year ahead?
		var day = date.getDate();
	    if(parseInt(day) < 10) day = "0" + day;
		var month = date.getMonth() + 1;
		if(parseInt(month) < 10) month = "0" + month;
		var option = new Option(shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear());
		option.value = date.getFullYear() + "-" + month +  "-" +  day;
		
		document.writeln("<OPTION value=" + option.value + ">" + shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear() + "</option>");
		
		date.setDate(date.getDate() + 1);
	}
	
	document.writeln("</SELECT>");
}







		