function yearChanged(year,type){
var month='';
if(type=='start')
month = document.getElementById("startMonth");
else
month = document.getElementById("endMonth");
var MMvalue = month.value;
var n = MonHead[MMvalue - 1];
if (MMvalue ==2 && IsPinYear(year.value))
n++;
writeDay(n,type)
}
function monthChanged(month,type){
var startyear ='';
if(type=='start')
startyear=document.getElementById("startYear");
else
startyear=document.getElementById("endYear");
var YYYYvalue = startyear.value;
var monthNum=month.value;
var n = MonHead[monthNum - 1];
if (monthNum ==2 && IsPinYear(YYYYvalue))
n++;
writeDay(n,type);
}
function writeDay(n,type)
{
var startday='';
if(type=='start')
startday= document.getElementById("startDay");
else
startday= document.getElementById("endDay");
var e = startday;
optionsClear(e);
for (var i=2; i<(n+1); i++){
if(i<10){
var temp='0'+i;
e.options.add(new Option(temp,temp));
}else{
var temp=i;
e.options.add(new Option(temp,temp));
}
}
}