// Browser-Bestimmung
ns4 = (document.layers)? true:false
ie = (document.styleSheets&&document.all)? true:false
mozilla = document.getElementById&&!document.all;
opera= (document.all&& !document.styleSheets)? true:false;

if (self != top) {
    top.location=self.location
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function rot_13(obj) { //v1.0
	var text	= new String(obj); var textrot	= new String();	var key = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	for(var i = 0; i < text.length; i++) {; var codechar	= text.substring(i, i + 1);var pos = key.indexOf(codechar.toUpperCase()); if(pos >= 0) {
	pos = (pos + key.length / 2) % key.length; codechar	= (codechar == codechar.toUpperCase()) ? key.substring(pos, pos + 1) : key.substring(pos, pos + 1).toLowerCase(); }; textrot	= textrot + codechar; }; return textrot
}


//Variable Funktionen
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function moveEbene() {
	if (top.ie) document.all.maschinen.style.top=document.body.scrollTop+72;
	if (top.ns6||top.opera) document.getElementById("maschinen").style.top=pageYOffset+72;
	if (top.ns4) document.maschinen.top=pageYOffset+72;
	setTimeout("moveEbene()",200);
}

function windowOpenNoScroll(dateiname,x,y) { 
	windowProperties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + x + ",height=" + y + ",left=" + (screen.availWidth/2-450) + ",top=" + (screen.availHeight/2-350)
	eval("wi" + "nd" + "ow.op" + "en" + "(dateiname,'popupwindow',windowProperties)")
}

function windowOpen(dateiname,x,y) {
	windowProperties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + x + ",height=" + y 
	eval("wi" + "nd" + "ow.op" + "en" + "(dateiname,'popupwindow',windowProperties)")
}

//Navigations-Hi-Anpassung: zeigt, wo man sich befindet
//Navigations-Hi-Anpassung: zeigt, wo man sich befindet
function navigationHi(strNavMain) {

// Navigation je nach gewähltem Websitebereich richtig darstellen

	if (strNavMain != "") {

	//Internet Explorer (wegen 5.x, ab 6 ginge auch das mozilla-Script)
		if (ie) {
			// obere MainNavigation
			document.all[strNavMain].style.color = '#000000'
		}
	//Mozilla
		if (mozilla) {
			// obere MainNavigation
			document.getElementsByName(strNavMain)[0].style.color = '#000000'
		}

	}

	//Ladezeit der Seite ermitteln
	getLadezeit()

	//KopfImage überblenden
	changeKopfImage(arrKopfImages);
}

//Auf zwei Dezimalstellen runden
function zweiDezimalStellen(x) {
  var k = (Math.round(x * 100) / 100).toString();
  k += (k.indexOf('.') == -1)? '.00' : '00';
  return k.substring(0, k.indexOf('.') + 3);
}

//Komma mit Punkt ersetzen
function zahlenFormat(numWert) {
	//Komma durch Punkt ersetzen
	var betrag = numWert
	if (betrag.indexOf(",")!=-1) {
		betrag = betrag.substring(0,betrag.indexOf(",")) + "." + betrag.substring(betrag.indexOf(",")+1,betrag.length)
	}
	return betrag;
}

//Punkt durch Komma ersetzen
function zahlenFormatKomma(numWert) {
	//Komma durch Punkt ersetzen
	var betrag = numWert
	if (betrag.indexOf(".")!=-1) {
		betrag = betrag.substring(0,betrag.indexOf(".")) + "," + betrag.substring(betrag.indexOf(".")+1,betrag.length)
	}
	return betrag;
}

// Eingabefeld mit Focus hervorheben, zurücksetzen
function colorHi(strFeld) {
	strFeld.style.background = "url(../../pic/animation_formularfeld.gif)";
}

function colorHiCombo(strFeld) {
	strFeld.style.background = "#F1D5DC";
}
function colorLo(strFeld) {
	strFeld.style.background = "#FFFFFF";
}

function colorHiButton(strFeld) {
	strFeld.style.color = "#ffffff";
}
function colorLoButton(strFeld) {
	strFeld.style.color = "#dddddd";
}



//rechte Maustaste
var message="";

function clickIE() {
//  if (document.all) {; (message);return false; }
}

function clickNS(e)  {
//  if (document.layers||(document.getElementById&&!document.all))
//    {; if (e.which==2||e.which==3); {; (message);return false; }; }
}

if (document.layers) {
//  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
} else  {
//  document.onmouseup=clickNS;document.oncontextmenu=clickIE;
}
//document.oncontextmenu=new Function("return false")


// globale Statuszeile
window.status = ""

//Ladezeit der Website ermitteln
var strLadezeit, start
start = new Date();

function getLadezeit() {
    ende = new Date(); 
	strLadezeit = ((ende.getTime() - start.getTime()) / 1000)
}
