	function checkForm()
	{
		if (document.frm.compname.value == "")
		{
			alert('You did not fill in a company name.');
			document.frm.compname.focus();
			return false;
		}
		
		if (document.frm.name.value == "")
		{
			alert('You did not fill in your name.');
			document.frm.name.focus();
			return false;
		}
		
		if (document.frm.phone.value == "")
		{
			alert('You did not fill in a phone number.');
			document.frm.phone.focus();
			return false;
		}
		
		if (document.frm.email.value == "")
		{
			alert('You did not fill in an email address.');
			document.frm.email.focus();
			return false;
		}
		
		var str=document.getElementById("email");
    	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(str.value))
		{
			alert("\"" + str.value + "\" is not a valid email address!");
			str.focus();
			return false;
		}
		
		if (document.frm.subject.value == "")
		{
			alert('You did not fill in a subject.');
			document.frm.subject.focus();
			return false;
		}
		
		if (document.frm.message.value == "")
		{
			alert('You did not fill in a message.');
			document.frm.message.focus();
			return false;
		}
		
		

		return true;
	}
	
	function mailForm()
	{	
		if (checkForm())
		{
			document.frm.submit();
		}
		return true;
	}
