function checkform(form1)
{
    if (!check_empty(document.form1.txtNAME.value))
    { 
		validity = false; alert('Please enter your Name'); 
		form1.txtNAME.focus();
		form1.txtNAME.select();
		return false;
	}
	if (isNumeric(document.form1.txtNAME.value) == true)
	{
		validity = false; alert('Please do not enter numbers'); 
		form1.txtNAME.focus();
		form1.txtNAME.select();
		return false;
	} 
	if (!check_empty(document.form1.txtCOMPANY.value))
    { 
		validity = false; alert('Please enter your Company Name'); 
		form1.txtCOMPANY.focus();
		form1.txtCOMPANY.select();
		return false;
	}
    if (!check_empty(document.form1.txtEMAIL.value))
    { 
		validity = false; alert('Please enter your Email Address'); 
		form1.txtEMAIL.focus();
		form1.txtEMAIL.select();
		return false;
	}	
    if (!isEmail(document.form1.txtEMAIL.value))
    { 
		validity = false; alert('Please enter a valid Email Address'); 
		form1.txtEMAIL.focus();
		form1.txtEMAIL.select();
		return false;
    }
	if (!check_empty(document.form1.txtPHONE.value))
    { 
		validity = false; alert('Please enter your Phone Number'); 
		form1.txtPHONE.focus();
		form1.txtPHONE.select();
		return false;
	}	
  
}
//--------------------------------------------------------------

function check_empty(text)
{
	  return (text.length > 0); // returns false if empty
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.length!=5 && field.length!=10) {
	alert("Please enter your 5 digit or 5 digit+4 zip code.");
	return false;
}
for (var i=0; i < field.length; i++) {
	temp = "" + field.substring(i, i+1);
	if (temp == "-") hyphencount++;
	if (valid.indexOf(temp) == "-1") {
		alert("Invalid characters in your zip code.  Please try again.");
		return false;
	}//end if
	if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
		alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
	return false;
	}//end if
}//end for
return true;
}

// function that checks for numerical characters 
function isNumeric(n) { 
      if (n == '0'  || n == '1'  || n == '2'  || n == '3'  || n == '4'  || n == '5'  || n == '6' || n == '7' || n == '8'  || n == '9') return(true);
      else return (false);
   }
