// JavaScipt Sammlung www.kremm.de

function BrowserCheck() {
  var b = navigator.appName
  if (b=="Netscape") this.b = "ns"
  else if (b=="Microsoft Internet Explorer") this.b = "ie"
  else this.b = b
  var p = navigator.platform.toLowerCase();
  if (p=="win32") this.p = "win"
  else if (p=="macppc") this.p = "mac"
  else if (p=="x11") this.p = "x11"
  else this.p = p
  this.uA = navigator.userAgent.toLowerCase();
  this.v = parseInt(navigator.appVersion);
  this.ns4 = (this.b=="ns" && this.v==4)
  this.ns6 = (this.b=="ns" && this.v>=5)
  this.ie4 = (this.uA.indexOf('msie 4')>0)
  this.ie5 = (this.uA.indexOf('msie 5')>0)
  this.ie6 = (this.uA.indexOf('msie 6')>0)
  this.ie7 = (this.uA.indexOf('msie 7')>0)
  this.ie8 = (this.uA.indexOf('msie 8')>0)
  this.winns4 = (this.b=="ns" && this.p=="win" && this.v==4)
  this.winns6 = (this.b=="ns" && this.p=="win" && this.v>=5)
  this.winie4 = (this.p=="win" && this.uA.indexOf('msie 4')>0)
  this.winie5 = (this.p=="win" && this.uA.indexOf('msie 5')>0)
  this.macns4 = (this.b=="ns" && this.p=="mac" && this.v==4)
  this.macns6 = (this.b=="ns" && this.p=="mac" && this.v>=5)
  this.macie4 = (this.p=="mac" && this.uA.indexOf('msie 4.5')>0)
  this.macie5 = (this.p=="mac" && this.uA.indexOf('msie 5')>0)
  this.other = ((this.p!="mac" && this.p!="win") || (this.b!="ns" && this.b!="ie") || this.uA.indexOf('aol')>0 || this.uA.indexOf('opera')>0);
  this.linux = (this.p.indexOf("linux")!=-1);
  if (this.ie5) this.v = 5;
  this.min = (this.ns4 || this.ie4);
}
is = new BrowserCheck();


/*------------------------*/

function FrameCheck(ZielDatei){
  if (!top.FramesetGeladen){
	if(document.images)
	  top.location.replace(ZielDatei);
	else
	  top.location.href = ZielDatei;
  }  
}

/*------------------------*/

function LayerInit(an){ 
  BrowserCheck();
  var LayerAnzahl = 2;
  var LayerName = "untermenu";
  if (ns6 || ie5 || ie6 || ie7 || ie8) {
    for (var i=1;i<=LayerAnzahl; i++) {
      document.getElementById(LayerName+i).style.visibility = "hidden";
    }
    document.getElementById(LayerName+an).style.visibility = "visible";
  }
  else if (ns4) {
    for (var i=1;i<=LayerAnzahl; i++) {
      document.layers[LayerName+i].visibility="hide";
    }
    document.layers[LayerName+an].visibility="show";
  }
  else if (ie4) {
    for (var i=1;i<=LayerAnzahl; i++) {
      en=eval(LayerName+i);
      en.style.visibility = "hidden";
    }
    en=eval(LayerName+an);
    en.style.visibility = "visible";
  }
  LayerPosition();
  if (parent.location.search.length > 0){
    SubmenuOn(1);
	SubmenuOn(2);
  }
}

/*------------------------*/

function LayerPosition() {
  BrowserCheck();
  var LayerAnzahl = 2;
  var LayerName = "untermenu";
  if (ns6 || ie5 || ie6 || ie7 || ie8) {
    for (var i=1;i<=LayerAnzahl; i++) {
	  if (i=1)
        document.getElementById(LayerName+i).style.left = 2;
	  if (i=2)
	    document.getElementById(LayerName+i).style.left = 20;
    }
  }
  else if (ns4) {
    for (var i=1;i<=LayerAnzahl; i++) {
      if (i=1)
	    document.layers[LayerName+i].left = 2;
	  if (i=2)
	    document.layers[LayerName+i].left = 20;
    }
  }
  else if (ie4) {
    for (var i=1;i<=LayerAnzahl; i++) {
      en=eval(LayerName+i);
      en.style.visibility = "hidden";
    }
  }
}

/*------------------------*/

function SubmenuOn(an) {
  BrowserCheck();
  var LayerName = "untermenu";
  if (ns6 || ie5 || ie6 || ie7 || ie8) {
    document.getElementById(LayerName+an).style.visibility = "visible";
  }
  else if (ns4) {
    document.layers[LayerName+an].visibility="show";
  }
  else if (ie4) {
	en=eval(LayerName+an);
    en.style.visibility = "visible";
  }
}

function VorschauZeigen (Ebene2Inhalt,Ebene3Inhalt) {
  Layersteuerung = window.parent.inhalt.LayerAnAus;
  if (Ebene2Inhalt){
    if (Layersteuerung == 1){
      window.parent.inhalt.zeigen(Ebene2Inhalt)
	}
  }
  if (Ebene3Inhalt){
    if (Layersteuerung == 2){
	  window.parent.inhalt.zeigen(Ebene3Inhalt)
	}
  }
}

function VorschauVerbergen (Ebene2Inhalt,Ebene3Inhalt) {
  Layersteuerung = window.parent.inhalt.LayerAnAus;
  if (Ebene2Inhalt){
    if (Layersteuerung == 1) {
	  window.parent.inhalt.verbergen(Ebene2Inhalt)
	}
  }
  if (Ebene3Inhalt){
    if (Layersteuerung == 2){
	  window.parent.inhalt.verbergen(Ebene3Inhalt)
	}
  }
}

/*------------------------*/

var F1 = null;
function neuesFensterVar(dateiname,x) {
/* für x gewünschte Werte für width=,height=,screenX=,screenY= eintragen */
 if (F1) {
   if (F1.closed == true) {
     F1 = window.open(dateiname,"Detail",x);
     setTimeout('F1.focus();',250);
   }
   else {
     F1.close();
     F1 = null;
     F1 = window.open(dateiname,"Detail",x);
     setTimeout('F1.focus();',250);
   }
 }
 else
 {
   F1 = window.open(dateiname,"Detail",x);
   setTimeout('F1.focus();',250);
 }
}

/*------------------------*/

function neuesFensterFix(dateiname) {
 var windowoptionen = "width=565,height=420,screenX=10,screenY=10";
 if (F1) {
   if (F1.closed == true) {
     F1 = window.open(dateiname,"Detail",windowoptionen);
     setTimeout('F1.focus();',250);
   }
   else {
     F1.close();
     F1 = null;
     F1 = window.open(dateiname,"Detail",windowoptionen);
     setTimeout('F1.focus();',250);
   }
 }
 else {
   F1 = window.open(dateiname,"Detail",windowoptionen);
   setTimeout('F1.focus();',250);
 }
}

/*------------------------*/