function checkform(frm1)
{
	var D=document;
	if (!check_empty(D.frm1.fNAME.value))
    { 
		validity = false; alert('Please enter your First Name'); 
		frm1.fNAME.focus();
		frm1.fNAME.select();
		return false;
	}
	if (!check_empty(D.frm1.lNAME.value))
    { 
		validity = false; alert('Please enter your Last Name'); 
		frm1.lNAME.focus();
		frm1.lNAME.select();
		return false;
	}
	if (!check_empty(D.frm1.Title.value))
    { 
		validity = false; alert('Please enter your Title'); 
		frm1.Title.focus();
		frm1.Title.select();
		return false;
	}
	if (!check_empty(D.frm1.txtEmail.value))
    { 
		validity = false; alert('Please enter your Email Address'); 
		frm1.txtEmail.focus();
		frm1.txtEmail.select();
		return false;
	}	
    if (!isEmail(D.frm1.txtEmail.value))
    { 
		validity = false; alert('Please enter a valid Email Address'); 
		frm1.txtEmail.focus();
		frm1.txtEmail.select();
		return false;
    }
	if (!check_empty(D.frm1.Company.value))
    { 
		validity = false; alert('Please enter your Company Name'); 
		frm1.Company.focus();
		frm1.Company.select();
		return false;
	}
    if (!check_empty(D.frm1.txtZIP.value))
    { 
		validity = false; alert('Please enter your Zipcode'); 
		frm1.txtZIP.focus();
		frm1.txtZIP.select();
		return false;
	}	
	if(D.frm1.cboJOBFUNCTION.selectedIndex==0)
	{
		validity = false; alert('Please select your job function'); 
		frm1.cboJOBFUNCTION.focus();
		return false;
	}
 	if(D.frm1.cboEMPLOYEES.selectedIndex==0)
	{
		validity = false; alert('Please select the number of employees'); 
		frm1.cboEMPLOYEES.focus();
		return false;
	}	 
	 	if(D.frm1.cboINDUSTRY.selectedIndex==-1)
	{
		validity = false; alert('Please select your primary business'); 
		frm1.cboINDUSTRY.focus();
		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);
   }
