// JavaScript to validate mEMo and forEMast e-mail subscriptions
// Used by http://www.elbornes.eu/index.php?section=subscribe
// 05-12-2006

function formSub(rwForm)
{
  email_msg = new Array(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$/,"Please enter a valid e-mail address.") 
	
	var result = email_msg[0].test(rwForm.email.value) 
	if(result == false) 
	{ 
		rwForm.email.focus() 
		alert (email_msg[1]) 
		return false; 
	}

	var result2 = email_msg[0].test(rwForm.emailconfirm.value) 
	if(result2 == false) 
	{ 
		rwForm.emailconfirm.focus() 
		alert (email_msg[1]) 
		return false; 
	}
	
	if(rwForm.email.value != rwForm.emailconfirm.value)
	{
		alert ('Your confirmation email address does not exactly match your email address. Please try again.') 
		return false; 		
	}	

	return true;
}
