function validateEMail(email) {
  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]){2,}\.)+([a-zA-Z0-9]{2,4})+$/;

  if(filter.test(email) == false) {
    return false;
  } else {
    return true;
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

var webAdminLogin  = "/login";
var webAdminLogout = "/logout";

document.onkeydown = keyListener; function keyListener(e){ if(!e){ e = window.event; } if(e.keyCode == 88) { if (e.ctrlKey == true) { document.location.href=webAdminLogin; } } if(e.keyCode == 89) { if (e.ctrlKey == true) { document.location.href=webAdminLogout; } } }

window.defaultStatus = "";

function _openPU(url,text) {
  _puWindow = window.open(url, "Web_PopUp","width=700,height=680,menubar=yes,resizable=yes,status=yes,scrollbars=yes");
  _puWindow.focus();
}

function openBiggerImage(repoURL,w,h) {
  var myW = w + 50;
  var myH = h + 50;
  _bwWindow = window.open("/service_showBiggerImage/" + repoURL, "Bigger_Image","width="+myW+",height="+myH+",menubar=yes,resizable=yes,status=yes,scrollbars=yes");
  _bwWindow.focus();
}

var winOpenString = "scrollbars=yes,status=yes,toolbar=no,location=yes,directories=no,resizable=yes,menubar=yes,width=800,height=600,top=100,left=100"
function openQuickFinder(objElm) {
  var linkValue  = objElm.options[objElm.selectedIndex].value
  var linkValues = linkValue.split("|");

  if (linkValue == "") {
    return;
  }

  if (linkValues[0] != "") {
    var lVWin = window.open(linkValues[1], linkValues[0], winOpenString);
    lVWin.focus();
  }
  else {
    document.location.href = linkValues[1];
  }
}
