// 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 nix(x)
	{
	if(x.blur)x.blur();
	}
	
// preload images, mouseover

function initLogo(max)
	{
	imo = new Array(); // Mouseover-Bilder
	ino = new Image(); // Normal-Zustand-Bilder
	if (document.images)
		{
		for (i=0;i<max;i++) 
			{
				dok=document;
				if (dok.images["logo"])
					{
					// Folder ermitteln
					url=dok.images["logo"].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+i+"."+nfound[1];
					}
					ino.src = url;
			}
		}
	myload=1;
	}
	
tout=0;

function over(x) // x=Bildnummer 
	{
	if (!myload) return;
	if (myload==0) return;
	xx="logo";
	document.images[xx].src = imo[x].src;
	clearTimeout(tout);
	}

function out(x)
	{
	if (!myload) return;
	if (myload==0) return;
	tout=setTimeout("logoBack("+x+")", 1000);
	}

function logoBack(x)
	{
	if (x>0) x=x-1;
	document.images["logo"].src = imo[x].src;
	if (x>0) setTimeout("logoBack("+x+")",x*30+80);
	}

// 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;
	}
	

	
// Weitere Zähne animieren 

function getWindowHeight()
	{
	if ((is_nav)+(is_opera5up)) 
		{
		return window.innerHeight;
		}
	else
		{
		return document.documentElement.clientHeight;
		}

	}

function getWindowWidth()
	{
	if ((is_nav)+(is_opera5up)) 
		{
		return window.innerWidth;
		}
	else
		{
		return document.documentElement.clientWidth;
		}

	}
	
	
var c1,c2,c3,id;
resize=1;
c1x=1035;
c1y=490;
c2x=1160;
c2y=845;

function moveCircle(cc)
	{
	setTimeout("moveTheCircle("+cc+")",1000)
	}

function moveTheCircle(cc)
	{
	if (cc==1)
		{
		h=getWindowHeight()-305;
		b=getWindowWidth()-304;
		c1=getLayerStyleRef("c1");
		if ((b>c1x)*(h>c1y))
			{
			id=c1;
			moveToPlace(c1x,-300,c1y,100,cc);
			}
		else
			{
			c1.left="-300px";
			c1.top="-300px";
			}
		}
	if (cc==2)
		{
		c2=getLayerStyleRef("c2");
		if ((b>c2x)*(h>c2y))
			{
			id=c2;
			moveToPlace(c2x,-300,c2y,100,cc);
			}
		else
			{
			c2.left="-300px";
			c2.top="-300px";
			}
		}
	}

function moveToPlace(x,ya,yz,v,ccc)
	{
	id.left=x+"px";
	id.top=ya+"px";
	ya=ya+v;
	v=Math.round((yz-ya)/20)+1;
	if (ya<yz) 
		{
		setTimeout("moveToPlace("+x+","+ya+","+yz+","+v+","+ccc+")",15)
		}
	else 
		{
		if (ccc==1) setTimeout("moveCircle(2)",500);
		}
	}

