﻿<!--

var jsDebug = true;

// Javascript Fehler unterdruecken
if(jsDebug == false) {
   onerror = stopError;
}

function stopError() {
   return true;
}

//Deaktiviert rechten Mausklick
function cancelEvent() {
   window.event.cancelBubble = true;
   window.event.returnValue  = false;
}

var breite;
var hoehe;

function logoAdjustment() {
   if (navigator.appName == "Netscape") {
      breite = innerWidth;
      hoehe = innerHeight;
   }
   else {
      breite = document.body.offsetWidth;
      hoehe = document.body.offsetHeight;
   }
   document.getElementById("logo").style.top = '24px';
   document.getElementById("logo").style.left = (breite - breite + 5) + 'px';
   document.getElementById("logo").style.visibility = 'visible';
}

function menuAdjustment() {
   //alert(document.getElementById("menu"));
   if((navigator.appName == 'Netscape' || navigator.appName == 'Konqueror') && document.getElementById("menu") != null) {
      document.getElementById("menu").style.left = (32 - 28) + 'px';
   }
   else if(navigator.appName == 'Microsoft Internet Explorer' && document.getElementById("menu") != null) {
      document.getElementById("menu").style.left = 7 + 'px';
   }
   //alert(navigator.appName);
}

//window.onresize = logoAdjustment;
window.onload = menuAdjustment;
/*
function menuOver(thisElem,strTitle) {
   thisElem.style.border='1px outset #000000';
   thisElem.style.cursor='hand';
   thisElem.style.color='#0000FF';
   thisElem.style.backgroundColor='#F0F0F0'
   thisElem.title = strTitle;
}

function menuOut(thisElem) {
   thisElem.style.border='1px solid #0D3F96';
   thisElem.style.cursor='none';
   thisElem.style.color='#000000';
   thisElem.style.backgroundColor='#FFFFFF';
}
*/
function jumpTo(strURL) {
   location.href = strURL;
}

function checkLoginForm(thisForm) {
   if(thisForm.username.value == '') {
      alert('Bitte einen Login Namen eingeben!');
      thisForm.username.focus();
      return false;
   }
   if(thisForm.password.value == '') {
      alert('Bitte ein Passwort eingeben!');
      thisForm.password.focus();
      return false;
   }
   //alert('Diese Funktion wird erst in Phase 2 realisiert bzw. implementiert!\n Mfg Pierre');
   return true;
}

function logoutConfirm(strURL) {
   if(confirm('Wollen sie sich wirklich ausloggen?')) {
      jumpTo(strURL);
   }
}

function randInt(min,max) {
   var div = (max - min) + 1
   var randNum = Math.random()
   for (var i = 0; i <= div - 1; i++) {
      if (randNum >= i / div && randNum < (i+1) / div) {
         return i + min
      }
   }
}

var wndInfo=null;
function InfoFenster(strPage) {
   imgwidth = 640;
   imgheight = 480;
   LeftPosition = (screen.width)?(screen.width-imgwidth)/2:100;
   TopPosition = (screen.height)?(screen.height-imgheight)/2:100;
   if(wndInfo!=null)
   if(!wndInfo.closed)wndInfo.close();
   windowconfig = 'top=' + TopPosition + ',left=' + LeftPosition + ',width=' + imgwidth + ',height=' + imgheight + ',dependent=yes,scrollbars=yes';
   wndInfo=window.open(strPage,'wndInfo',windowconfig);
   wndInfo.focus();
}

function agbFenster(strPage) {
   imgwidth = 640;
   imgheight = 480;
   LeftPosition = (screen.width)?(screen.width-imgwidth)/2:100;
   TopPosition = (screen.height)?(screen.height-imgheight)/2:100;
   if(wndInfo!=null)
   if(!wndInfo.closed)wndInfo.close();
   windowconfig = 'top=' + TopPosition + ',left=' + LeftPosition + ',width=' + imgwidth + ',height=' + imgheight + ',dependent=yes,scrollbars=yes';
   wndInfo=window.open(strPage,'wndInfo',windowconfig);
   wndInfo.focus();
}

function detailFenster(strPage) {
   imgwidth = 640;
   imgheight = 480;
   LeftPosition = (screen.width)?(screen.width-imgwidth)/2:100;
   TopPosition = (screen.height)?(screen.height-imgheight)/2:100;
   if(wndInfo!=null)
   if(!wndInfo.closed)wndInfo.close();
   windowconfig = 'top=' + TopPosition + ',left=' + LeftPosition + ',width=' + imgwidth + ',height=' + imgheight + ',dependent=yes,scrollbars=yes,status=0';
   wndInfo=window.open(strPage,'wndInfo',windowconfig);
   wndInfo.focus();
}

function checkFrmAnmeldung(thisForm) {
   if(thisForm.inpUsername.value == '') {
      alert('Bitte einen Benutzername eingeben!');
	  thisForm.inpUsername.focus();
	  return false;
   }
   if(thisForm.inpPasswort.value == '') {
      alert('Bitte einen Passwort eingeben!');
	  thisForm.inpPasswort.focus();
	  return false;
   }
   if(thisForm.inpPasswortRepeat.value == '') {
      alert('Bitte das Passwort wiederholen!');
	  thisForm.inpPasswortRepeat.focus();
	  return false;
   }
   if(thisForm.inpPasswort.value != thisForm.inpPasswortRepeat.value) {
      alert('Bitte das Passwort pr�fen\nPasswort stimmt nicht mit Wiederholung �berein!');
	  return false;
   }
   if(thisForm.inpVorname.value == '') {
      alert('Bitte einen Vornamen eingeben!');
	  thisForm.inpVorname.focus();
	  return false;
   }
   if(thisForm.inpNachname.value == '') {
      alert('Bitte einen Nachnamen eingeben!');
	  thisForm.inpNachname.focus();
	  return false;
   }
   if(thisForm.inpStrasse.value == '') {
      alert('Bitte eine Straße eingeben!');
	  thisForm.inpStrasse.focus();
	  return false;   
   }
   if(thisForm.inpHausnummer.value == '') {
      alert('Bitte eine Hausnummer eingeben!');
	  thisForm.inpHausnummer.focus();
	  return false;   
   }
   if(thisForm.inpPlz.value == '') {
      alert('Bitte eine Postleitzahl eingeben!');
	  thisForm.inpPlz.focus();
	  return false;   
   }
   if(thisForm.inpOrt.value == '') {
      alert('Bitte einen Ort eingeben!');
	  thisForm.inpOrt.focus();
	  return false;   
   }
   if(thisForm.inpTelefonnummer.value == '') {
      alert('Bitte eine Telefonnummer eingeben!');
	  thisForm.inpTelefonnummer.focus();
	  return false;   
   }
   if(thisForm.inpEmail.value == '') {
      alert('Bitte eine Email Adresse eingeben!');
	  thisForm.inpEmail.focus();
	  return false;
   }
   return true;
}

function conSelectAction(x) {
   location.href = 'container.php?cID=' + x;
}

function frmKontaktCheck() {
   frm = document.frmKontakt;
   if(frm) {
      if(frm.inpName.value == '') {
         alert('Bitte einen Namen eingeben!');
         frm.inpName.focus();
         return false;
      }
      if(frm.inpEmail.value == '') {
         alert('Bitte eine Emailadresse eingeben!');
         frm.inpEmail.focus();
         return false;
      }
      if(frm.inpEmail.value.indexOf(".") <= 0 || frm.inpEmail.value.indexOf("@") <= 0 || frm.inpEmail.value.length < 6) {
         alert('Bitte eine gültige Emailadresse eingeben!');
         frm.inpEmail.focus();
         return false;
      }
      if(frm.txtBetreff.value == '') {
         alert('Bitte einen Betreff eingeben!');
         frm.txtBetreff.focus();
         return false;
      }
   }
}
//-->
