
function checkForm()
{
var	apos=document.enrollFrm1.e_mail.value.indexOf("@");
var dotpos=document.enrollFrm1.e_mail.value.lastIndexOf(".");
var contlength=window.document.enrollFrm1.other_info1.value;
  if(trim(window.document.enrollFrm1.first_name.value) == '')
   {
      alert('First Name is required');
      window.document.enrollFrm1.first_name.focus();
      return false;
   } 
  else if(trim(window.document.enrollFrm1.last_name.value) == '')
   {
      alert('Last Name is required');
      window.document.enrollFrm1.last_name.focus();
      return false;
   }
   else if(trim(window.document.enrollFrm1.e_mail.value) == '')
   {
      alert('Email is required');
      window.document.enrollFrm1.e_mail.focus();
      return false;
   }
    else if (window.document.enrollFrm1.e_mail.value  !=  window.document.enrollFrm1.con_e_mail.value )
{
window.document.enrollFrm1.e_mail.focus();
alert("Email and Confirm Email must match");
return false;
   }
  else if (apos<1||dotpos-apos<2) 
	{
		window.document.enrollFrm1.e_mail.focus();
		alert("Please enter a valid email address");		
	return false;
	}
 
   else if(trim(window.document.enrollFrm1.password.value) == '')
   {
      alert('Password is required ');
     window.document.enrollFrm1.password.focus();
      return false;
   }
  else if (window.document.enrollFrm1.password.value  !=  window.document.enrollFrm1.con_password.value )
{
window.document.enrollFrm1.password.focus();
alert("Password and Confirm Password must match");
return false;
   }
   else if(trim(window.document.enrollFrm1.street.value) == '')
   {
      alert('Street is required');
      window.document.enrollFrm1.street.focus();
      return false;
   }
   else if(trim(window.document.enrollFrm1.city.value) == '')
   {
      alert('City is required');
      window.document.enrollFrm1.city.focus();
      return false;
   }
   
   
    else if(trim(window.document.enrollFrm1.state.value) == 'default')
   {
      alert('State is required');
      window.document.enrollFrm1.state.focus();
      return false;
   }
   else if(trim(window.document.enrollFrm1.degree.value) == '0')
   {
      alert('Degree is required');
      window.document.enrollFrm1.degree.focus();
      return false;
   }
   else if(trim(window.document.enrollFrm1.major.value) == '0')
   {
      alert('Major is required');
      window.document.enrollFrm1.major.focus();
      return false;
   }
   
    
    else if ((window.document.enrollFrm1.resume_file_name.value == '') &&  (contlength.length < 200 ))
{
window.document.enrollFrm1.other_info1.focus();
alert("NOT SUFFICIENT INFORMATION. Please add more details of your experience (education/work history) so that we can properly evaluate your credentials. You may attach your resume to satisfy this requirement");
return false;
   }
   else if(document.enrollFrm1.terms.checked == false ) 
   {
      alert('You must agree to the terms to apply');
      
      return false;
   }
   else
   {
      window.document.enrollFrm1.first_name.value = trim(window.document.enrollFrm1.first_name.value);
       window.document.enrollFrm1.last_name.value   = trim( window.document.enrollFrm1.last_name.value);
      window.document.enrollFrm1.e_mail.value = trim(window.document.enrollFrm1.e_mail.value);
      window.document.enrollFrm1.con_e_mail.value = trim(window.document.enrollFrm1.con_e_mail.value);
	  window.document.enrollFrm1.password.value = trim(window.document.enrollFrm1.password.value);
       window.document.enrollFrm1.con_password.value   = trim( window.document.enrollFrm1.con_password.value);
      window.document.enrollFrm1.street.value = trim(window.document.enrollFrm1.street.value);
      window.document.enrollFrm1.city.value = trim(window.document.enrollFrm1.city.value);
	  window.document.enrollFrm1.zip.value = trim(window.document.enrollFrm1.zip.value);
      window.document.enrollFrm1.phone.value = trim(window.document.enrollFrm1.phone.value);
      return true;
   }
}

function trim(str)
{
   return str.replace(/^\s+|\s+$/g,'');
}

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0

  if(window.screen)if(isCenter)if(isCenter=="true"){

    var myLeft = (screen.width-myWidth)/2;

    var myTop = (screen.height-myHeight)/2;

    features+=(features!='')?',':'';

    features+=',left='+myLeft+',top='+myTop;

  }

  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);

}
