function check(){
	f = document.forms[0];
	msg = "";
	if(f.Dfirstname.value == "") msg = "- First Name\n";
	if(f.Dlastname.value == "")  msg = msg + "- Last Name\n";
	if(f.Dcompany.value == "")		msg = msg + "- Company\n";
	if(f.Dphone1.value == "")		msg = msg + "- Business Phone\n";
	if(f.Demail.value == "")		msg = msg + "- Email\n";
	if(f.Daddress1.value == "") 	msg = msg + "- Business Address\n";
	if(f.Dstate.value == "")		msg = msg + "- State\n";
	if(f.Dzip.value == "") msg = msg + "- ZIP\n";
	if (msg != "")
	{
		alert("The following fields are required:\n" + msg);
		return false;
	}

	if(!ForceNumber(f.Dphone1,"Business Phone"))
	{	}
	else
	if(isNaN(f.Dext1.value)){
		alert("Please check Business Phone Extension.");
		f.Dext1.focus();
	}else
	if(!ForceNumber(f.Dphone2,"Other Phone"))
	{	}
	else
	if(isNaN(f.Dext2.value)){
		alert("Please check Other Phone Extension.");
		f.Dext2.focus();
	}else
	if(!ForceNumber(f.Dfax,"FAX Number"))
	{	}
	else
	if(isNaN(f.Dext3.value)){
		alert("Please check FAX Number Extension.");
		f.Dext3.focus();
	}else
	if(!ForceNumber(f.Dphone3,"Mobile Number"))
	{   }
	else
	if(!isEmail(f.Demail.value)){
		alert("Check the Email field!");
		f.Demail.focus();
	}else
	if(isNaN(f.Dzip.value)){
		alert("Please check ZIP.\n(Value should be a No.)");
		f.Dzip.focus();
	}
	else
		{
		var randomnumber=Math.floor(Math.random()*11);
		window.open("contact_usform.php?"+randomnumber,"contact_usform","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];
}
