function check(){
	f = document.forms[0];
	msg = "";
	if(f.name.value == "") msg = "- Name\n";
	if(f.yyyy.value == "")	msg = msg + "- Year in demo date\n";
	if(f.MM.value == "")	msg = msg + "- Minutes in demo time\n";
	if(f.phone.value == "") msg = msg + "- Business Phone\n";
	if(f.email.value == "") msg = msg + "- Email\n";
	if (msg != "")
	{
		alert("The following fields are required:\n" + msg);
		return false;
	}
	
	if(!isEmail(f.email.value)){
		alert("Check the Email field!");
		f.email.focus();
	}else
	if(isNaN(f.yyyy.value) || f.yyyy.value.length < 4 || parseInt(f.yyyy.value) < 2002){
		alert("Check the Year field!\n(Use 'yyyy' format)");
		f.yyyy.focus();
	}else
	if(isNaN(f.MM.value) || parseInt(f.MM.value) < 0 || parseInt(f.MM.value) > 59){
		alert("Check the Minutes field!");
		f.MM.focus();
	}else
	if(parseInt(f.HH.options[f.HH.selectedIndex].text) == 8 && parseInt(f.MM.value) < 30){
		alert("Choose a Time value between 8:30 a.m. to 4:00 p.m.");
		f.MM.focus();
	}
	else
	if(parseInt(f.HH.options[f.HH.selectedIndex].text) == 4 && parseInt(f.MM.value) > 0){
		alert("Choose a Time value between 8:30 a.m. to 4:00 p.m.");
		f.MM.focus();
	}
	else
	if(!ForceNumber(f.phone,"Phone")) ;
	else {
		window.open("","customer_support","top=150,left=100,width=600,height=300");
		return true;
	}
	return false;
}
function AP(){
	if(parseInt(document.forms[0].HH.options[document.forms[0].HH.selectedIndex].text) < 8){
		document.forms[0].AMPM.value = "PM"
	}
	else{
		document.forms[0].AMPM.value="AM"
	}
	if(parseInt(document.forms[0].HH.options[document.forms[0].HH.selectedIndex].text) == 4){
		document.forms[0].MM.value = "00";
	}
	return void[0];
}
function mmDays(){	
	f = document.forms[0];
	var iMM = parseInt(f.mm.options[f.mm.selectedIndex].text);
	if(iMM == 2 && f.dd.length==29) return void[0];
	else if((iMM == 1 ||iMM ==3 || iMM ==5 || iMM ==7 || iMM ==8 ||iMM ==10 || iMM ==12) && f.dd.length==31) return void[0];
	else if(f.dd.length==30) return void[0];
	
	f.dd.length=0;
	for(i=1;i<30;i++)
	{
		var opt = new Option();
		opt.text = i;
		f.dd.options[f.dd.options.length] = opt;
	}
	if(iMM != 2){
		var opt = new Option();
		opt.text = 30;
		f.dd.options[f.dd.options.length] = opt;
	}	
	if(iMM == 1 ||iMM ==3 || iMM ==5 || iMM ==7 || iMM ==8 ||iMM ==10 || iMM ==12){
		var opt = new Option();
		opt.text = 31;
		f.dd.options[f.dd.options.length] = opt;
	}
	return void[0];
}
