								function checkemail(){
										var testresults;			
										var str=document.advisor_form.email.value;
										var filter=/^(['_a-z0-9-+]+)(\.['_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,5})$/i
										if (filter.test(str))
										testresults=true
										else				
										testresults=false				
										return (testresults)			
								}
								
								function isNumeric(s) {
			          if(s == null)
			          return false;
		            
			          if(s.length == 0)
			          return false;
		            
			          for(var i=0; i<s.length; ++i)
			          {
			          	if("1234567890".indexOf(s.charAt(i)) < 0)
			          	{
			          		return false;
			          	}
			          }
			          return true;
			          }


                function ValidateForm(){

                        //make sure that the email is not blank.
                        if (checkemail()==false)  {
                                //it isn't so show the user an alert and go to that field
                         				alert("Please enter a valid email address");
                                document.advisor_form.email.focus();
                                //and return false so the form doesn't get submitted
                                return false;
                        }
                        
                        //check area code
                          if ((document.advisor_form.userid.value.length < 6) || (isNumeric(document.advisor_form.userid.value)==false))
                          {
                          	alert ("Please check your User ID, it doesn't appear to be valid");
                          	document.advisor_form.userid.focus();
                          	return false;
                          }                                                               
                        
                        //everything checks out, submit the form
                        return true;
                }

