/*
    
    Date: 10/19/06	

    This Code and Idea is Copyright 2003 MatakaInternational LLC
    CandyShotGlass.com is a division of MatakaInternational LLC. By no means
    may this code or idea be implemented without written authority
    by MatakaInternational LLC or its divisions.

*/
function checkform() {
	var missing = "";
	var count = 0;
		
if (document.theform.firstname.value == "" || document.theform.firstname.value == document.theform.firstname.defaultValue) { missing +="\n Contact Name"; }
	//if (document.theform.lastname.value == "" || document.theform.lastname.value == document.theform.lastname.defaultValue) { missing +="\n Last Name"; }
if ( !(/^[^@]+@[^@]+(\.[^@]+)+$/.test(document.theform.email1.value))) { missing +="\n Email address"; };
if ( !(/^[^@]+@[^@]+(\.[^@]+)+$/.test(document.theform.email2.value))) { missing +="\n Confirm Email address"; };
if ((document.theform.email1.value) != (document.theform.email2.value)) { missing +="\n Email\'s Dont Match"; };
//if (document.theform.orgarea.value == "" || document.theform.orgarea.value == document.theform.orgarea.defaultValue || ! isNumeric(document.theform.orgarea.value)) { missing +="\n Orginization Phone Area Code"; }

if ( (document.theform.orgarea.value) || (document.theform.orgphone.value) ) 
{
	if (document.theform.orgarea.value == "" || document.theform.orgarea.value == document.theform.orgarea.defaultValue || ! isNumeric(document.theform.orgarea.value)) { missing +="\n Phone Area Code"; }
	if (document.theform.orgphone.value == document.theform.orgphone.defaultValue || !(/^\d{3}-?\d{4}$/.test(document.theform.orgphone.value))) { missing +="\n Phone number"; }
	if (!document.theform.best_time.selectedIndex) { missing +="\n Best Time To Call"; }
}
															 
//if (!document.theform.state.selectedIndex) { missing +="\n State"; }
if (document.theform.subject.value == "" || document.theform.subject.value == document.theform.subject.defaultValue) { missing +="\n Subject"; }
if (document.theform.inquiry.value == "" || document.theform.inquiry.value == document.theform.inquiry.defaultValue) { missing +="\n Enter Inquiry"; }
	
//if (!document.theform.COUNTRY.selectedIndex) { missing +="\n Country"; }
//if (document.theform.regarea.value == "" || document.theform.regarea.value == document.theform.regarea.defaultValue || ! isNumeric(document.theform.regarea.value)) { missing +="\n Phone Area Code"; }
//if (document.theform.regphone.value == document.theform.regphone.defaultValue || !(/^\d{3}-?\d{4}$/.test(document.theform.regphone.value))) { missing +="\n Phone number"; }


	if (missing !="") 
	{
		missing = "Please enter the following information: \n" + missing;
		alert(missing);
		return false;
	} 
	else 
	{
		return true; 
	}
}
