function runnian(num){

//var num=new Number(document.form.year.value);
if ((num%4==0 & num%100!=0)||num%400==0){
    //alert(num+"是闰年！");
    return true;}
else
   {
   //alert(num+"不是闰年！");
   return false;}


}

function valdayspm(year,month,day){
theyear=year;
themonth=month;
theday=day;

//theyear=document.form.year.value;
//themonth=document.form.month.value;
//theday=document.form.day.value;
//document.write (theyear+themonth+theday);

switch (themonth){
case "4":
     if (theday>30){
        alert("4月只有30天！");
        return false;}
     else
        return true;
     break;
case "6":
     if (theday>30){
        alert("6月只有30天！");
        return false;}
     else
        return true;
     break;
case "9":
     if (theday>30){
        alert("9月只有30天！");
        return false;}
     else
        return true;
     break;
case "11":
     if (theday>30){
        alert("11月只有30天！");
        return false;}
     else
        return true;
     break;
case "2":
     if (runnian(theyear)==false){
        // document.write ("**");
         if (theday>28){
             alert("非闰年2月只有28天！");
             return false;}
         else
             return true;
         }
     else  {      
             if (theday>29){
             alert("闰年2月只有29天！");
             return false;}
         else
             return true;
         }
     break;
defalut:	
     return true;
     
}

}