function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function checkForm(frm){

	if(myform.company_name.value==''){
		alert('Please enter your Company Name.');
		myform.company_name.focus();
		return false;
	}
	
	if(myform.contact_name.value==''){
		alert('Please enter your Contact Name.');
		myform.contact_name.focus();
		return false;
	}
	
		if(myform.phone.value==''){
		alert('Please enter your Contact Phone Number.');
		myform.phone.focus();
		return false;
	}		
	
	
	  if (myform.email.value == ""){
    alert("Please enter a valid email address.");
    myform.email.focus();
    return (false);
  }

  if (!isEmailAddr(myform.email.value)){
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    myform.email.focus();
    return (false);
  }
   
  if (myform.email.value.length < 3){
    alert("Please enter at least 3 characters for your email address.");
    myform.email.focus();
    return (false);
  }
	
}

		
	