function checkAnmeldeForm(form) {
  if(checkEmptyVal(form.vorname) ||
     checkEmptyVal(form.nachname) ||
	 checkEmptyVal(form.email) ||
	 checkEmptyVal(form.email2)) {
    alert("Bitte f\u00fcllen Sie alle mit * gekennzeichneten Formularfelder aus.");	 
	return false;
  }
  if(form.email.value != form.email2.value) {
    alert("Bitte \u00fcberpr\u00fcfen Sie die eigegebenen E-Mail Adressen.");	 
    return false;
  }

  return true;
}

function checkKontaktForm(form) {
  if(checkEmptyVal(form.vorname) ||
     checkEmptyVal(form.nachname) ||
	 checkEmptyVal(form.email) ||
	 checkEmptyVal(form.nachricht)) {
    alert("Bitte f\u00fcllen Sie alle mit * gekennzeichneten Formularfelder aus.");	 
	return false;
  }
  return true;
}

function checkNewsletterForm(form) {
  if(checkEmptyVal(form.vorname) ||
     checkEmptyVal(form.nachname) ||
	 checkEmptyVal(form.email)) {
    alert("Bitte f\u00fcllen Sie alle mit * gekennzeichneten Formularfelder aus.");	 
	return false;
  }
  return true;
}

function checkEmptyVal(obj) {
  return obj.value == "";
}

function toggleTeamBiblioBlock() {
  el = document.getElementById('teamBiblioBlock')
  if ( el.style.display != 'none' ) { el.style.display = 'none'; }
  else                              { el.style.display = '';     }
}

function printPage() {
  window.print();
}

function onLoadMgmt() {
  setContentMinHeight();
}

function setContentMinHeight() {
  if(null == document.getElementById("content")) {
    return false;
  }
  var theHeight;
  var offset = 406;
//  var offset = 384;
  var offsetadd = 20;
  if (window.innerHeight) {
    theHeight=window.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) {
    theHeight=document.documentElement.clientHeight;
    offset = offset+offsetadd;
  }
  else if (document.body) {
    theHeight=document.body.clientHeight;
  }
  var toSetMinHeight = (theHeight-offset);
  if (toSetMinHeight > 0) {
    document.getElementById("content").style.minHeight=toSetMinHeight + "px";
  }
}

function searchBoxEntry(box) {
  if(box.value=='SUCHEN') {
    box.value='';
  }
}

function searchBoxExit(box) {
  if(box.value=='') {
    box.value='SUCHEN';
  }
}



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];
  }
}

