//browser detection
var isNav=false;
var isIE=false;
var coll;
var style;
var activeMenu = 0;

if( parseInt(navigator.appVersion) >= 4){
        if(navigator.appName == "Netscape"){
        isNav = true;
        coll = "document";
        style = "";
        } else {
        isIE = true;
        coll="document.all";
        style = ".style";
        }
}

if(!isNav && !isIE){
top.location.href="anderebrowser.htm"
}
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

var menu_aktiv = 0;
function menu(Rubrik, offset)
{
if( menu_aktiv != Rubrik) {
  if (menu_aktiv) menu_zu("menu"+menu_aktiv);
  if (isNav) {
  eval('document["' + 'menu' + Rubrik + '"].top = offset');
  eval('document["' + 'menu' + Rubrik + '"].left = 150');
  } else {
  eval('document.all["' + 'menu' + Rubrik + '"].style.pixelTop = offset');
  eval('document.all["' + 'menu' + Rubrik + '"].style.pixelLeft = 150');
  }
}
menu_auf("menu"+Rubrik);
menu_aktiv = Rubrik;
}

function menu_auf(menu_name){
eval(coll + '["' + menu_name + '"]' + style + '.visibility = "visible"');
}

function menu_zu(menu_name){
eval(coll + '["' + menu_name + '"]' + style + '.visibility = "hidden"');
}

function alleaus(){
if (menu_aktiv)
{menu_zu("menu"+menu_aktiv);
menu_aktiv = 0;}
}

function init() {
if (isNav) {document.captureEvents(Event.MOUSEUP);}
document.onmouseup = alleaus;
}

 var pop1Window=null;
function pop1(mypage,myname,w,h,pos,infocus){
if(pos=='random'){
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
pop1Window=window.open('',myname,settings);
if(infocus=='front'){pop1Window.focus();pop1Window.location='pkw.htm';}
}

 var pop2Window=null;
function pop2(mypage,myname,w,h,pos,infocus){
if(pos=='random'){
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
pop2Window=window.open('',myname,settings);
if(infocus=='front'){pop2Window.focus();pop2Window.location='aufwand.htm';}
}

 var pop3Window=null;
function pop3(mypage,myname,w,h,pos,infocus){
if(pos=='random'){
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
pop3Window=window.open('',myname,settings);
if(infocus=='front'){pop3Window.focus();pop3Window.location='afa.htm';}
}


function CheckInhalt(Feld,Name2)
{
 if(isNaN(Feld) == true || (Feld<0)) {
 alert("Überprüfen Sie Ihre Eingabe!");
 }
  else{
   switch (Name2){
    case "ELp":
     if (Feld>0) {
	 var bafa = Feld / 6;
      document.test.EAfa.value = bafa.toFixed(2);
	  }
	 else{
	 alert("Überprüfen Sie Ihre Eingabe!");
	 }
     break;
    case "Ekm":
     if (! Feld>0) {
	 alert("Eingabe erforderlich!");
	  }
     break;
     case "Ekmp":
     if ((Feld*1)>(document.Test.Ekm.value*1)) {
	 alert("Die private Laufleistung darf nicht über der Gesamten liegen!");
	  }
     break;
    }
 }
}

