/* SCRIPTS */
function isEmpty(strfield1, strfield2, strfield3, strfield4) {
  //change "field1, field2 and field3" to your field names
	strfield1 = document.forms[1].company.value 
	strfield2 = document.forms[1].fullname.value
	strfield3 = document.forms[1].email.value
  //company field
    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("Please enter your company name.")
    return false;
    }
  //fullname field
    if (strfield2 == "" || strfield2 == null || !isNaN(strfield2) || strfield2.charAt(0) == ' ')
    {
    alert("Please enter your full name.")
    return false;
    }
  //email field 
    if (strfield3 == "" || strfield3 == null || strfield3.charAt(0) == ' ')
    {
    alert("Please enter your e-mail address.")
    return false;
    }
    return true;
}

//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[1].email.value;
   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      alert('Please enter a valid e-mail address.');
      return false;
    } 
    return true; 
}

//function that performs all functions, defined in the onsubmit event handler
function check(form){
if (isEmpty(form.field1)){
	if (isEmpty(form.field2)){
	  if (isEmpty(form.field3)){
		if (isValidEmail(form.email)){
		  return true;
		}
	  }
	}
}
return false;
}

//onclick, select all
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}