var oY=document.getElementById("inputYear"),oM=document.getElementById("inputMonth"),oD=document.getElementById("inputDate");
var oT=new Date(),oTTY=oT.getFullYear()+2;
for(var i=oT.getFullYear();i<oTTY;i++){
	var oPtion=document.createElement("option");oPtion.value= i ;oPtion.text = i ;
	if(i==oT.getFullYear())oPtion.selected=true;
	try{oY.add(oPtion,null);}catch(e){oY.add(oPtion);}
}
oM.onchange=function(){
	chgDate(oY.value,this.value);
}
for(var i=1;i<=12;i++){
	var oPtion=document.createElement("option");oPtion.value= i ;oPtion.text = i ;
	if(i==oT.getMonth()+1)oPtion.selected=true;
	try{oM.add(oPtion,null);}catch(e){oM.add(oPtion);}
}
function chgDate(iY,iM){
	oD.options.length = 0;
	var oDD= new Date(iY+"/"+(Number(iM)+1)+"/0");
	var iDD= oDD.getDate();
	for(var i=1;i<=iDD;i++){
		var oPtion=document.createElement("option");oPtion.value= i ;oPtion.text = i ;
		if(i==oT.getDate())oPtion.selected=true;
		try{oD.add(oPtion,null);}catch(e){oD.add(oPtion);}
	}
}
chgDate(oY.value,oM.value);
