
function isEmail(str)
{
    var isEmail = (((((str.indexOf("@") != -1) && (str.indexOf(".") != -1)) && 	(((str.lastIndexOf("@")-str.lastIndexOf("."))<-1))) && str.indexOf("@")!=0) && (str.length-str.lastIndexOf(".")>1));

     if (isEmail){
	return (true);
     }

     else{
	return (false);
     }
}



function FeedbackForm_Validator(theForm)
{

  if (theForm.first_name.value == "")
  {
    alert("Please enter your First Name.");
    theForm.first_name.focus();
    return (false);
  }
  if (theForm.last_name.value == "")
  {
    alert("Please enter your Last Name.");
    theForm.last_name.focus();
    return (false);
  }
  if (theForm.company.value == "")
  {
    alert("Please enter your Company/Organization name.");
    theForm.company.focus();
    return (false);
  }
  if (theForm.phone.value == "")
  {
    alert("Please enter your Daytime Phone Number.");
    theForm.phone.focus();
    return (false);
  }
  var str=theForm.email.value;
  if (str == "")
  {
	alert("Please enter your email address.");
	theForm.email.focus();	
	return(false);
  }
	
  if (isEmail(str) == false)
  {
	alert("" + str + " is an invalid Email Address!");
	theForm.email.focus();
	return (false);
  }  

}


