// Javascript Fehler unterdruecken
//onerror = stopError;
function stopError()
{
return true;
}

// Umgebungsvariablen auslesen

	// convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));


myload=0;
// blur focus

function bluur(x)
	{
	if(x.blur)x.blur();
	}
	
// Ebenen ansprechen nach Browserversion

function getLayerStyleRef(layname)
	{
	if (is_nav4) return document.layers[layname];
	if (is_ie4) return document.all[layname].style;
	if (is_ie5up) return document.getElementById(layname).style;
	if (is_opera5up) return document.getElementById(layname).style;
	if (is_nav6up) return document.getElementById(layname).style;
	return null;
	}
	

	
// Bei kleinen Fenstergrößen Newsspalte ausschalten

function getWindowWidth()
	{
	if ((is_nav)+(is_opera5up)) 
		{
		return window.innerWidth;
		}
	else
		{
		return document.body.clientWidth;
		}

	}


var pos0;

function posSuche()
	{
	if ((agt.indexOf("gecko/2")!=-1)*(agt.indexOf("mozilla/5.0")!=-1)*(agt.indexOf("win 9x")!=-1)*(agt.indexOf("netscape")==-1)*(agt.indexOf("phoenix")==-1))
		{
		pos0=getLayerStyleRef("topnavig");
		pos0.marginRight=0;
		//pos0.display="none";
		} 
	if  ((myload==1)*(is_ie))
		{
		w=getWindowWidth();
		pos0=getLayerStyleRef("suchform");
		pos0.left=w-140;
		}
	if  ((myload==1)*(is_opera5))
		{
		pos0=getLayerStyleRef("suchform");
		pos0.visibility="hidden";
		}
	if (!is_nav4)setTimeout("posSuche()",1000);
	enLarge();
	}

// Lesezeichen setzen

function Bookmark()
	{
	url=document.URL;
	title=document.title;
	if (is_nav4) alert('Bitte drücken Sie die beiden Tasten "Strg"+"d" gleichzeitig, um ein Lesezeichen für diese Seite anzulegen.')
	else if (is_nav6up) alert('Bitte drücken Sie die beiden Tasten "Strg"+"g" gleichzeitig, um ein Lesezeichen für diese Seite anzulegen.')
	else if (is_opera) alert('Bitte drücken Sie die beiden Tasten "Strg"+"t" gleichzeitig, um ein Lesezeichen für diese Seite anzulegen.')
	else window.external.AddFavorite(url,title)
	}
	
myload=1;
	
// Drucken und Zurück zur Bildschirmversion

function drucken()
	{
	if (!is_opera) 
		{
		setTimeout("location.href=turl;",10000);
		window.print();
		}
	}

// PopUp Fenster öffnen

var ioWindow;

function openWindow(url,x,y)
	{
	if (ioWindow) {if (!ioWindow.closed) ioWindow.close()}
	h=screen.availHeight-30;
	w=screen.availWidth-30;
	t=(h-y)/2; if (t<0) t=0;
	u=(w-x)/2; if (w<0) w=0;
	ioWindow = window.open(url,"popup",'width='+x+',height='+y+',left='+u+',top='+t+',scrollbars=yes');
	ioWindow.focus();
	}
	
// Form PopUp Fenster öffnen

var formWindow;

function openFormWindow(url,x,y)
	{
	if (formWindow) {if (!formWindow.closed) formWindow.close()}
	h=screen.availHeight-30;
	w=screen.availWidth-30;
	t=(h-y)/2; if (t<0) t=0;
	u=(w-x)/2; if (w<0) w=0;
	formWindow = window.open(url,"formpopup",'width='+x+',height='+y+',left='+u+',top='+t+',scrollbars=yes');
	formWindow.focus();
	}
	
// Formular-Buttons Rollover

function butover(x)
	{
	if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"1."+nfound[1];
	}
	
function butout(x)
	{
	if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"0."+nfound[1];
	}
	

	

// preload images, mouseover

function initImages()
	{
	imo = new Array(); // Mouseover-Bilder
	ino = new Array(); // Normal-Zustand-Bilder
	if (document.images)
		{
		for (i=0;i<80;i++) 
			{
			ll=0;
			if (is_nav4) ll=document.layers.length;
			for (l=-1; l<ll; l++)
				{
				dok=document;
				if ((is_nav4)*(l!=-1)) dok=document.layers[l].document;
				if (dok.images["b"+i])
					{
					// Folder ermitteln
					url=dok.images["b"+i].src;
					found=url.split("/");
					nfound=found[found.length-1].split(".");
					nlength=nfound[0].length-1;
					folder=url.replace(found[found.length-1],"");
					name=nfound[0].substr(0,nlength);
					imo[i] = new Image(); imo[i].src = folder+name+"1."+nfound[1];
					ino[i] = new Image(); ino[i].src = url;
					}
				}
			}
		}
	}


function over(x,lay) // x=Bildnummer lay=Ebenen-id
	{
	if (!myload) return;
	if (myload==0) return;
	dok=document;
	if (lay) dok=getdok(lay);
	xx="b"+x;
	dok.images[xx].src = imo[x].src;
	}

function out(x,lay)
	{
	if (!myload) return;
	if (myload==0) return;
	dok=document;
	if (lay) dok=getdok(lay);
	xx="b"+x;
	if (dok.images[xx].src.indexOf("1.")>-1) dok.images[xx].src = ino[x].src;
	}



	
// IE Onclick-Rahmen ausblenden

function nix(x)
	{
	if ((is_nav6)+(is_ie)) x.blur();
	}
	

// 0,7 Prozent des Einkommens berechnen

function getBill()
	{
	auswahl=document.rechner;
	if (auswahl.elements[0].value=="") return;
	einkommen=parseFloat(auswahl.elements[0].value);
	if (isNaN(einkommen)) return;
	ergebnis=(einkommen)*7/1000;
	auswahl.elements[1].value=runde(ergebnis)+" Euro";
	}

function runde(x)
	{
	x=x*100;
	x=Math.round(x);
	x=x/100;
	if (Math.round(x)==x) x=x+".00";
	else if (Math.round(x*10)==x*10) x=x+"0";
	x=x+" ";
	return x;
	}

// Höhe berechnen und gesamten Platz füllen

function getWindowHeight()
	{
	if ((is_nav)+(is_opera5up)) 
		{
		return window.innerHeight;
		}
	else
		{
		return document.documentElement.clientHeight;
		}

	}
	
	
var pos0;
resize=1;

function enLarge()
	{
	hc=0;
	if (document.getElementById("content")) hc=hc+document.getElementById("content").offsetHeight;
	if (document.getElementById("contentnrp")) hc=hc+document.getElementById("contentnrp").offsetHeight;
	if (document.getElementById("contentnr")) hc=hc+document.getElementById("contentnr").offsetHeight;
	h=getWindowHeight()-111;
	ww=document.documentElement.clientWidth-document.getElementById("all").offsetWidth;
	if ((h>hc)*(resize==1)*(ww>=0))
		{
		pos0=getLayerStyleRef("middle");
		pos0.height=h+"px";
		resize=0;
		}
	setTimeout("enLarge()",1000);
	}

