function echeck(str) 
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	
	if (str.indexOf(at)==-1)
	{
		alert("Invalid E-mail Address");
		return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
	   alert("Invalid E-mail Address");
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{
	    alert("Invalid E-mail Address");
	    return false;
	}

	if (str.indexOf(at,(lat+1))!=-1)
	{
		alert("Invalid E-mail Address");
		return false;
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	{
	    alert("Invalid E-mail Address");
	    return false;
	}

	if (str.indexOf(dot,(lat+2))==-1)
	{
	    alert("Invalid E-mail Address");
	    return false;
	}
		
	if (str.indexOf(" ")!=-1)
	{
		alert("Invalid E-mail Address");
		return false;
	}
	
	return (true);	
					
}		  
	  
function jt_Form1_Validator(theForm)
{
	
	var emailID=theForm.useremail;

	if (theForm.username.value == "")
	{
    	alert("Please enter a value for the \"Name\" field.");
    	theForm.username.focus();
    	return (false);
	}
  
  	if (theForm.company.value == "")
  	{
    	alert("Please enter a value for the \"Company\" field.");
    	theForm.company.focus();
    	return (false);
  	}
	
	if (theForm.state.value == "Please Select")
  	{
   		alert("Please select a value for the \"State\" field.");
    	theForm.state.focus();
    	return (false);
  	}  
  
  	if (theForm.useremail.value == "")
  	{
    	alert("Please enter a value for the \"Email\" field.");
    	theForm.useremail.focus();
    	return (false);
  	}
  
  	if (theForm.email2.value == "")
  	{
    	alert("Please enter a value for the \"Email Confirmation\" field.");
    	theForm.email2.focus();
    	return (false);
  	}
   
  	if (theForm.useremail.value != theForm.email2.value)
  	{
    	alert("The \"Email\" and \"Email Confirmation\" fields must match.");
    	theForm.useremail.focus();
    	return (false);
  	}
  
  	if (echeck(emailID.value)==false)
  	{
		emailID.focus();
		return (false);
 	}   
	
	  
 // 	if (theForm.interests.value == "")
 // 	{
 //   	alert("Please select your interests.");
 //   	theForm.interests.focus();
 //   	return (false);
 // 	}  
	
	if (theForm.Action.value == "Please Select")
  	{
    	alert("Please select Follow-up.");
    	theForm.Action.focus();
    	return (false);
  	}
  
  	//if (theForm.imgverify.value == "")
  	//{
    //	alert("Please enter a value for the \"Image Verify\" field.");
    //	theForm.imgverify.focus();
    //	return (false);
  	//}  
    
	return (true);
}
