//Regexp for testing email addy validity
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

// -----------------------------------------------

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// -----------------------------------------------
//  Members only
// -----------------------------------------------
function CheckPageLogin(){
  if ( !re.test(document.frmPage.mo_email.value) ){
  alert("There\'s a problem with the email address you entered.")
  document.frmPage.mo_email.focus();
  return false;
  }
  if(document.getElementById("mo_pwd")){
	  if (document.frmPage.mo_pwd.value.length <= 0){
	  alert('Please enter your password.');
	  document.frmPage.mo_pwd.focus();
	  return false;
	  }
  }
}
function CheckMastheadLogin(){
  if (!re.test(document.frmMasthead.mo_email.value)){
  alert("There\'s a problem with the email address you entered.  Please re-check it and try again.")
  document.frmMasthead.mo_email.focus();
  return false;
  }
  if(document.frmMasthead.mo_pwd.value.length <= 0){
  alert('Please enter your password.');
  document.frmMasthead.mo_pwd.focus();
  return false;
  }  
 }
function CheckNewPassword(){
  if (document.frmPage.mo_pwd.value.length <= 0){
  alert('Please enter your current password.');
  document.frmPage.mo_pwd.focus();
  return false;
  }
  if(document.frmPage.mo_pwd_new.value.length <= 0){
  alert('Please enter a new password.');
  document.frmPage.mo_pwd_new.focus();
  return false;
  }
  if(document.frmPage.mo_pwd_new.value != document.frmPage.mo_pwd_new2.value){
  alert('Please make sure you verify your new password.');
  document.frmPage.mo_pwd_new.value = '';
  document.frmPage.mo_pwd_new2.value = '';
  document.frmPage.mo_pwd_new.focus();
  return false;
  }
} 
 

function SendEmail(){
  var tld = 'cltk' + 'appas.com';
  var str = 'ma' + 'il' + 'to:dig' + 'ital' + 'nupe@' + tld;
  document.location.href = str;
}

function SetContact(argPrefix){
  var tld = 'alphalambda' + 'omega.org';
  var str = 'ma' + 'il' + 'to:' + argPrefix + '@' + tld;
  document.location.href = str;
}