//Requires malvernreg.js to be loaded first
//Test browser for cookies, before doing anything else
MIL.testCookie();
    
//Create MIL.reg sub-namespace, if not already created
if (typeof(MIL.reg)=="undefined") MIL.reg = {};
//Create MIL.reg.localization sub-namespace, if not already created
if (typeof(MIL.reg.localization)=="undefined") MIL.reg.localization = {};
MIL.initialize = function() {
  if (document.getElementById("regEmailAddress").value == "" ) {
    document.getElementById("regEmailAddress").focus();
  }
};
MIL.reg.validate = function(){
  if ( MIL.reg.validation.email( "regEmailAddress" ) ) {
    return true;
  } else {
    alert ( MIL.reg.localization.invalidEmail );
    document.getElementById ( "regEmailAddress" ).focus
    return false;
  }
};
MIL.reg.submit = function() {
  if ( MIL.reg.validate() ) {
    document.forms[0].submit();
  } 
}

