	var date_arr = new Array;
	var days_arr = new Array;
	
	date_arr[0]=new Option("January",31);
	date_arr[1]=new Option("February",28);
	date_arr[2]=new Option("March",31);
	date_arr[3]=new Option("April",30);
	date_arr[4]=new Option("May",31);
	date_arr[5]=new Option("June",30);
	date_arr[6]=new Option("July",31);
	date_arr[7]=new Option("August",30);
	date_arr[8]=new Option("September",30);
	date_arr[9]=new Option("October",31);
	date_arr[10]=new Option("November",31);
	date_arr[11]=new Option("December",30);
	
	function fill_select(f)
	{
	        document.writeln("<SELECT name=\"dob_month\" id=\"dob_month\" class=\"input_small\" onchange=\"update_days(phy_registration)\">");
	        for(x=0;x<12;x++)
	                document.writeln("<OPTION value=\""+date_arr[x].value+"\">"+date_arr[x].text);
	        document.writeln("</SELECT><SELECT name=\"dob_day\" id=\"dob_day\" class=\"input_small\"></SELECT>");
	        selection=f.dob_month[f.dob_month.selectedIndex].value;
	}
	
	function update_days(f)
	{
	        temp=f.dob_day.selectedIndex;
	        for(x=days_arr.length;x>0;x--)
	        {
	                days_arr[x]=null;
	                f.dob_day.options[x]=null;
	         }
	        selection=parseInt(f.dob_month[f.dob_month.selectedIndex].value);
	        ret_val = 0;
	        if(f.dob_month[f.dob_month.selectedIndex].value == 28)
	        {
	                year=parseInt(f.dob_year.options[f.dob_year.selectedIndex].value);
	                if (year % 4 != 0 || year % 100 == 0 ) ret_val=0;
	                else
	                        if (year % 400 == 0)  ret_val=1;
	                        else
	                                ret_val=1;
	        }
	        selection = selection + ret_val;
	        for(x=1;x < selection+1;x++)
	
	        {
	                days_arr[x-1]=new Option(x);
	                f.dob_day.options[x-1]=days_arr[x-1];
	        }
	        if (temp == -1) f.dob_day.options[0].selected=true;
	        else
	             f.dob_day.options[temp].selected=true;
	}
	function year_install(f)
	{
	        document.writeln("<SELECT name=\"dob_year\" id=\"dob_year\" class=\"input_small\" onchange=\"update_days(phy_registration)\">")
	        for(x=1930;x<2006;x++) document.writeln("<OPTION value=\""+x+"\">"+x);
	        document.writeln("</SELECT>");
	        update_days(f)
	}