//sets day select to approprate days
function check_days(id) {
	days=new Array(29,31,28,31,30,31,30,31,31,30,31,30,31);
	m = $('#'+id+'M').val();
	if (m==2&&($('#'+id+'Y').val()%4==0)) m=0;
	sel = $('#'+id+'D');
	opt = "<select name=\""+sel.attr('name')+"\" id=\""+id+"D\">";
	for (i=1;i<=days[m];i++){
		opt+='<option value="'+i+'"';
		if (sel.val() == i) opt+=' selected="selected"';
		opt+='>'+i+'</option>';
	}
	opt+="</select>";
	sel.remove();
	$('#'+id).prepend(opt);
}