var eAddrGood;
function checkemail(field) {

    var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

    if (goodEmail){
        eAddrGood = true
    } else {
        eAddrGood = false
    }
} //end checkEmailAddr


function checkField(f)
{
    for (var j=0; j < f.value.length; j++)
    {
        if  (f.value.charAt(j) == "'") 
        {
            f=" ";
            alert("Do not use the single quote ( ' ) .") ;
            return false;
        }
    }
    if( f.value.length < 1 ) 
    {
        return false ;
    }
    return true;
}

function checkForm(form){
   eAddrGood = false ;
   checkemail(form.rep_email) ;

    if(!form.agree.checked)
    {
        alert('Please check this box to show that you understand the rules.') ;
        form.agree.focus() ;
        return false ;
    }
	
	if(!checkField(form.rep_name) )
    {
        alert('Please enter your first and last name.') ;
        form.fname.focus() ;
        return false ;
    }
    if(!checkField(form.rep_title) )
    {
        alert('Please enter your title.') ;
        form.lname.focus() ;
        return false ;
    }

    if(eAddrGood == false) 
    {
        alert('Please enter a valid email address.');
        form.rep_email.focus() ;
        return false ;
    }
	
}

