			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 dayfield_to=document.getElementById("daydropdown_to")
				
				var monthfield=document.getElementById(monthfield)
				var monthfield_to=document.getElementById("monthdropdown_to")
				var yearfield=document.getElementById(yearfield)
				var yearfield_to=document.getElementById("yeardropdown_to")

				for (var i=0; i<31; i++){
				dayfield.options[i]=new Option(i+1, i+1)
				dayfield_to.options[i]=new Option(i+1, i+1)
				}
				dayfield[today.getDate()-1].selected=true;
				dayfield_to[today.getDate()-1].selected=true;

				for (var m=0; m<12; m++) {
				monthfield.options[m]=new Option(monthtext[m], m+1)
				monthfield_to.options[m]=new Option(monthtext[m], m+1)
				}
				monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], today.getMonth()+1, true, true) //select today's month
				monthfield_to.options[today.getMonth()]=new Option(monthtext[today.getMonth()], today.getMonth()+1, true, true)
				
				var thisyear=today.getFullYear()
				for (var y=0; y<7; y++){
				yearfield.options[y]=new Option(thisyear, thisyear)
				yearfield_to.options[y]=new Option(thisyear, thisyear)
				thisyear-=1
				}
				yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
				yearfield_to.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
			}
			
			function doSubmit(){
				 var primaryURL = "/corporate/ems/loadData.do";
				 var beginDate = document.getElementById("monthdropdown")[document.getElementById("monthdropdown").selectedIndex].value + "/" + document.getElementById("daydropdown")[document.getElementById("daydropdown").selectedIndex].value + "/" + document.getElementById("yeardropdown")[document.getElementById("yeardropdown").selectedIndex].value;
				 var endDate = document.getElementById("monthdropdown_to")[document.getElementById("monthdropdown_to").selectedIndex].value + "/" + document.getElementById("daydropdown_to")[document.getElementById("daydropdown_to").selectedIndex].value + "/" + document.getElementById("yeardropdown_to")[document.getElementById("yeardropdown_to").selectedIndex].value;
				 document.location = primaryURL + "?startDate=" + beginDate + "&endDate=" + endDate;
			}


			window.onload=function(){
				populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
			}