/***********************************************
* Drop Down Date select script- by JavaScriptKit.com
* This notice MUST stay intact for use
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and more
***********************************************/

var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];

function populatedropdown(dayfield, monthfield, yearfield){
var today=new Date();
var dayfield=document.getElementById(dayfield);
var monthfield=document.getElementById(monthfield);
var yearfield=document.getElementById(yearfield);
var nextday =new Date();
for (var i=0; i<31; i++)
dayfield.options[i]=new Option(i+1, i+1)
dayfield.value=today.getDate();

//dayfield.options[today.getDate()]=new Option(today.getDate()+1, today.getDate()+1, true, true) //select today's day
if(dayfield.name=="departureDay"){
	nextday=new Date(today.getFullYear(), today.getMonth(), today.getDate()+1);
	dayfield.value=nextday.getDate();
}

for (var m=0; m<12; m++)
	monthfield.options[m]=new Option(monthtext[m], m+1)
monthfield.value=nextday.getMonth()+1;
//monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], today.getMonth()+1, true, true) //select today's month

var thisyear=today.getFullYear()
for (var y=0; y<3; y++){
yearfield.options[y]=new Option(thisyear, thisyear)
thisyear+=1
}
yearfield.value=nextday.getFullYear();
//yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
}
