var today = new Date();
var day = today.getDate();
var month = today.getMonth() + 1;
var year = today.getFullYear();
var maxYears = 5;

/*document.getElementById('quickbookArrDay').onload = addOptions(document.getElementById('quickbookArrDay'),1,31,1,day);
document.getElementById('quickbookArrMon').onload = addOptions(document.getElementById('quickbookArrMon'),1,12,1,month);
document.getElementById('quickbookArrYear').onload = addOptions(document.getElementById('quickbookArrYear'),year,maxYears,1,year);
document.getElementById('quickbookDepDay').onload = addOptions(document.getElementById('quickbookDepDay'),1,31,1,day+1);
document.getElementById('quickbookDepMon').onload = addOptions(document.getElementById('quickbookDepMon'),1,12,1,month);
document.getElementById('quickbookDepYear').onload = addOptions(document.getElementById('quickbookDepYear'),year,maxYears,1,year);*/
document.getElementById('NewsArrDay').onload = addOptions(document.getElementById('NewsArrDay'),1,31,1,day);
document.getElementById('NewsArrMon').onload = addOptions(document.getElementById('NewsArrMon'),1,12,1,month);
document.getElementById('NewsArrYear').onload = addOptions(document.getElementById('NewsArrYear'),year,maxYears,1,year);

function addOptions(obj,minVal,count,incrementVal,selected){
	var e = document.getElementById(obj.id);

	// create the options
	for(i=0,j=minVal;i<count;i++,j+=incrementVal){		
		e.options[i] = new Option(j,j);
		// set the default option
		if(selected != null && selected == j)	{
			e.options[i].selected = true;
		}
	}
}

