function checkformEmail(formEmail)

{ var fobj=formEmail;
  	var alertMsg_2 = "Please complete the following:\n";
	
	var l_Msg = alertMsg_2.length;

alertMsg_2 += checkEmail(formEmail.em.value);
alertMsg_2 += checkPassword(formEmail.pw.value);
  
  // ** START **
  
	//email
function checkEmail(strng){
var emailFilter=/^.+@.+\..{2,3}$/;
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/

 if (strng == "") {
 		alertMsg_2 = " - Enter your email address..\n";
    }
	
  else if  (!(emailFilter.test(strng))) {
		alertMsg_2 =  " - Your email address appears to be incorrect.\n";
  }
 
	else if (strng.match(illegalChars)) {
   alertMsg_2 =  " - Your email address  contains illegal characters.\n";
	 }
else  {
   alertMsg_2 =  "";
	 }	
return alertMsg_2;
}//end Email
	
	//Password function
function checkPassword (strng1) {
 var illegalChars = /[\W_]/; // allow only letters and numbers
 if (strng1 == "") {
    alertMsg2 =  " - Enter a password\n";
 }
 
  	else{ 
	alertMsg2=""
	}
return alertMsg2;
}

  	
	if (alertMsg_2.length == l_Msg){
		return true;
	}else{
		alert(alertMsg_2);
		
	return false;
	}
}



function checkEmail(formEmail)

{ var fobj=formEmail;
  	var alertMsg_2 = "Please complete the following:\n";
	
	var l_Msg = alertMsg_2.length;

alertMsg_2 += checkEmail(formEmail.em.value);

  
  // ** START **
  
	//email
function checkEmail(strng){
var emailFilter=/^.+@.+\..{2,3}$/;
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/

 if (strng == "") {
 		alertMsg_2 = " - Enter your email address..\n";
    }
	
  else if  (!(emailFilter.test(strng))) {
		alertMsg_2 =  " - Your email address appears to be incorrect.\n";
  }
 
	else if (strng.match(illegalChars)) {
   alertMsg_2 =  " - Your email address  contains illegal characters.\n";
	 }
else  {
   alertMsg_2 =  "";
	 }	
return alertMsg_2;
}//end Email
	
	//Password function
 	
	if (alertMsg_2.length == l_Msg){
		return true;
	}else{
		alert(alertMsg_2);
		
	return false;
	}
}

