// JScript File   


      
    function mfSave()
    {     
      var strErrors = '';
      
      //Validate the form
      if (document.getElementById('txtMemberName').value == '') strErrors = strErrors + 'You must enter a display name\n';
      if (document.getElementById('txtEmail').value == '') strErrors = strErrors + 'You must enter an email address\n';
	  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	  if (!filter.test(document.getElementById('txtEmail').value)) strErrors = strErrors + 'You must enter a valid email address\n';     
      if (document.getElementById('txtPassword1').value.length < 5 ) strErrors = strErrors + 'You must enter a Password more than 5 characters\n';
      if (document.getElementById('txtPassword1').value != document.getElementById('txtPassword2').value) strErrors = strErrors + 'Your passwords must match\n';
      
     // if (document.getElementById('fleLogo').value != '')
     // {
     //   if (document.getElementById('fleLogo').value.substring(document.getElementById('fleLogo').value.length -4).toLowerCase() != '.jpg' && document.getElementById('fleLogo').value.substring(document.getElementById('fleLogo').value.length -4).toLowerCase() != '.gif' ) strErrors = strErrors + 'You must upload only .gif or .jpg files\n';
     // }
      //if (document.getElementById('txtAddress1').value == '') strErrors = strErrors + 'You must enter address1\n'  
      //if (document.getElementById('cboCounty').value == '') strErrors = strErrors + 'You must enter a county\n'; 
      if (strErrors == '')
      {
        document.getElementById('cmdSave').disabled = true;
        document.forms[0].submit();     
      }
      else
      {
        alert('We were unable to save details for this Member due to the following:\n\n' + strErrors + '\nPlease resolve these issues and try again');
      }
    }
    

   




