function submitForm()
{
		//puts the date fields together and submits form
		var dateOne = new Date(document.resLauncher.yeardropdown.value, document.resLauncher.monthdropdown.value, document.resLauncher.daydropdown.value);
		document.resLauncher.checkInDate.value = (dateOne.getFullYear() + "-" + (dateOne.getMonth()+1) + '-' + dateOne.getDate());
		
			var dateTwo = dateOne;
			var  numNights = parseInt(document.resLauncher.nights.value);
			dateTwo.setDate(dateTwo.getDate()+numNights);
			document.resLauncher.checkOutDate.value = (dateTwo.getFullYear() + '-' + (dateTwo.getMonth()+1) + '-' + dateTwo.getDate());
		document.resLauncher.submit();
}

var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];

function populatedropdown(dayfield, monthfield, yearfield, addNum){
var today=new Date()
today.setDate(today.getDate() + addNum);
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
var yearfield=document.getElementById(yearfield)
for (var i=0; i<31; i++)
dayfield.options[i]=new Option(i+1, i+1)
dayfield.selectedIndex = (today.getDate()-1)
for (var m=0; m<12; m++)
monthfield.options[m]=new Option(monthtext[m], m)
monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], today.getMonth(), true, true) //select today's month
var thisyear=today.getFullYear()
for (var y=0; y<20; y++){
yearfield.options[y]=new Option(thisyear, thisyear)
thisyear+=1
}
yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
}

//populatedropdown(id_of_day_select, id_of_month_select, id_of_year_select)
window.onload=function(){
populatedropdown('daydropdown', 'monthdropdown', 'yeardropdown', 0)

}

document.write(getCalendarStyles());

var cal15 = new CalendarPopup();
cal15.setReturnFunction('setMultipleValues4');
	function setMultipleValues4(y,m,d) {
		m--;
		document.forms[0].yeardropdown.value=y;
		document.forms[0].monthdropdown.selectedIndex=m;
		for (var i=0; i<document.forms[0].daydropdown.options.length; i++) {
			if (document.forms[0].daydropdown.options[i].value==d) {
				document.forms[0].daydropdown.selectedIndex=i;
				}
			}
	}
	
var cal16 = new CalendarPopup();
cal16.setReturnFunction('setMultipleValues5');
	function setMultipleValues5(y,m,d) {
		m--;
		document.forms[0].yeardropdown2.value=y;
		document.forms[0].monthdropdown2.selectedIndex=m;
		for (var i=0; i<document.forms[0].daydropdown2.options.length; i++) {
			if (document.forms[0].daydropdown2.options[i].value==d) {
				document.forms[0].daydropdown2.selectedIndex=i;
				}
			}
	}

function getDateString() {
	var y = document.resLauncher.yeardropdown.value;
	var m = document.resLauncher.monthdropdown.value;
	var d = document.resLauncher.daydropdown.value;
		m++;
		if(m==13) {
			c=1;	
		}

return str= y+'-'+m+'-'+d;

}
