

function populatedropdown(dayfield, monthfield){
var today=new Date()
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
//var yearfield=document.getElementById(yearfield)
 var thisyear=today.getFullYear()
  var thisyr=String(thisyear)
 var thisyr1=thisyr.slice(2,4)
 var currmonth= today.getMonth()
 var currentday =  today.getDate()
     //next year
var nextyear=String(thisyear+1)
var next1=nextyear.slice(2,4)
var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
var monthpo1=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
for (var ii=0; ii<31; ii++)
{
 //new stuff
           if(ii==(currentday-1)){ // if the counter is equal to today's date, var "sel" = "selected"
      dayfield.options[ii]=new Option(ii+1, ii+1, true, true)
      }
      else{
     dayfield.options[ii]=new Option(ii+1, ii+1)
      }

 //end ne
 //old stuff

//dayfield.options[ii]=new Option(ii+1, ii+1)
//end old
}
//dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day
var pos = 0
for (var m=0; m<(12-currmonth); m++) {
pos=m
monthfield.options[m]=new Option(monthtext[currmonth+m]+" "+ thisyear, thisyear+"-"+(currmonth+m+1))

}

     // option display,value
 for (var p=0; p<12; p++)
 {
 pos=pos+1
monthfield.options[pos]= new Option(monthpo1[p]+" "+ nextyear, nextyear+"-"+(p+1))

  //select today's month
// monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true)

  }

//monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true) //select today's month

//for (var y=0; y<2; 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
//2008-5

}


