/*function logon(){
  var userName = document.getElementById( "idUserName" );
  var password = document.getElementById( "idPassword" );
  var getVars = '?user=' + userName.value + '&password=' + password.value;
  var req = getHttpRequest();
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', 'IsValidLogon.php' + getVars, false);
    req.send(null);
    if( req.responseText.toString().substr(0,1)  == '1' ){
      window.location.href = 'Logon.php' + getVars;
      return;
    }
  }
  clientSideInclude('VisibleTable','Logon_Failed.php' + getVars);
}
*/

function resetPasswordByEmail( emailAdres ){
  var email = document.getElementById( "idEmail" ).value;

  if(!isValidEmailAdress(email)){
    alert( 'Het email adres is ongeldig. Het email adres is nodig om het wachtwoord te verzenden.' );
    return;
  }
  alert('ResetPassword.php?email=' + email);
  // call reset.php
  clientSideInclude('VisibleTable','ResetPassword.php?email=' + email);
}

function resetPasswordByUser( userName ){
  // call reset.php
  clientSideInclude('VisibleTable','ResetPassword.php?user=' + userName);
}

function isValidEmailAdress(emailAdress){
  var filter;
  filter  = /^([a-zA-Z0-9_\.\-]+)\@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9]{2,4})+$/;
  return filter.test(emailAdress);
}


function checkEmail()
{
  var frmInschrijf;	
  var coachmail;  
  frmInschrijf = document.getElementById( 'InschrijfForm' );
  coachmail = document.getElementById( 'coachmail' );
        //alert( coachmail.value );
  if (isValidEmailAdress(coachmail.value))
  { 
    frmInschrijf.submit();
  }
  else 
    alert('Het email adres is ongeldig. Het email adres is nodig om het wachtwoord te verzenden.');
}	
