// JavaScript Document 
    function correctMonth(year, month, menu){
      // menü -> 1: begin  2: end
      if(menu == 1){
        var myselect=document.myForm.nap;
      }else{
        var myselect=document.myForm.t_nap;
      }
      if((month == 1) || (month == 3) || (month == 5) || (month == 7) || (month == 8) || (month == 10) || (month == 12)){
        if(myselect.length != 31){
          for(i=myselect.length+1 ; i<=31; i++){
            try{
              myselect.add(new Option(i+'', i+''), null);
            }
            catch(e){ //in IE, try the below version instead of add()
              myselect.add(new Option(i+'', i+''));
            }          
          }
         } 
      }else if(month == 2){
            //TODO
            if(year % 4 == 0){
              if(myselect.length < 29){
                correctMonth(year, 1, menu);
              }
              while(myselect.length > 29){
                myselect.remove(myselect.length-1);
              }
            }else{
              while(myselect.length > 28){
                myselect.remove(myselect.length-1);
              }
            }
            
      }else{
          if(myselect.length != 30){
            if(myselect.length > 30){
              myselect.remove(myselect.length-1);
            }else{
              for(i=myselect.length+1 ; i<=30; i++){
                try{
                  myselect.add(new Option(i+'', i+''), null);
                }
                catch(e){ //in IE, try the below version instead of add()
                  myselect.add(new Option(i+'', i+''));
                }          
              }
            }
          }
        
      }
    }
    
  
    function selectNow(){
      var today = new Date();
      var day = today.getDate();
      var month = today.getMonth();
      var year = today.getFullYear();
      
      document.myForm.ev.options[year-2010].selected = true;
      document.myForm.honap.options[month].selected = true;
      document.myForm.nap.options[day-1].selected = true;
      correctMonth(year, month + 1, 1);
      
      document.myForm.t_ev.options[year-2010].selected = true;
      document.myForm.t_honap.options[month].selected = true;
      document.myForm.t_nap.options[day-1].selected = true;
      correctMonth(year, month + 1, 2);
      
      document.myForm.xora.options[today.getHours()].selected = true;
      document.myForm.perc.options[(today.getMinutes()-(today.getMinutes()%5))/5].selected = true;
    }   

