// 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_mac = (agt.indexOf("mac") != -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();
	}
	
// Navigation Tabellenzellen Rollover

function tover(x)
	{
	if (is_nav4) return;
	if ((x>9)*(x<30)) 
		{
		document.getElementById("tv"+x).style.background="url(../images/over_v.gif)";
		document.getElementById("td"+x).style.background="url(../images/over_bg.gif)";
		document.getElementById("tn"+x).style.background="url(../images/over_n.gif)";
		}
	if (((x>29)*(x<50))) 
		{
		document.getElementById("td"+x).style.background="#FBEBAE";
		document.getElementById("tn"+x).style.background="#FBEBAE";
		document.getElementById("tv"+x).style.background="#FBEBAE"
		}
	}
	
function tout(x,y)
	{
	if (is_nav4) return;
	if ((x>9)*(x<30)) 
		{
		if (y)
			{
			document.getElementById("td"+x).style.background="url(../images/aktiv_bg.gif)";
			document.getElementById("tv"+x).style.background="url(../images/aktiv_v.gif)";
			document.getElementById("tn"+x).style.background="url(../images/aktiv_n.gif)";
			return
			}
		else
			{
			document.getElementById("td"+x).style.background="url(../images/navi_bg.gif)";
			document.getElementById("tv"+x).style.background="url(../images/navi_bg.gif)";
			document.getElementById("tn"+x).style.background="url(../images/navi_bg.gif)";
			return
			}
		}
	if (((x>29)*(x<50))) 
		{
		if (y)
			{
			document.getElementById("td"+x).style.background="url(../images/lnavigaktiv.gif)";
			document.getElementById("tn"+x).style.background="url(../images/lnavigaktiv.gif)";
			document.getElementById("tv"+x).style.background="url(../images/lnavigaktiv.gif)"
			return
			}
		else
			{
			document.getElementById("td"+x).style.background="#ffffff";
			document.getElementById("tn"+x).style.background="#ffffff";
			document.getElementById("tv"+x).style.background="#ffffff"
			return
			}
		} 
	}
	
// 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];
	}
	
// 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,"popuprii",'width='+x+',height='+y+',left='+u+',top='+t+',scrollbars=yes');
	ioWindow.focus();
	}	


// PopUp Fenster Größe korrigieren öffnen

function reSizze(x,y)
	{
	if (is_nav4) {x=x-10;y=y-30}
	if (is_mac) {x=x+20;y=y+30}
	window.resizeTo(x+10,y+30)
	}
	
function reSizzeX(x,y)
	{
	if (top.window.name=='popuprii') {reSizze(x,y)} else top.window.location.href='http://www.dusch-wc24.de'
	}


// preload images, mouseover

function initImages()
	{
	zz=top.window.name;
	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;
					}
				}
			}
		}
	myload=1;
	top.window.name=zz;
	}


function over(x) // x=Bildnummer lay=Ebenen-id
	{
	if (!myload) return;
	if (myload==0) return;
	xx="b"+x;
	document.images[xx].src = imo[x].src;
	}

function out(x,lay)
	{
	if (!myload) return;
	if (myload==0) return;
	xx="b"+x;
	if (document.images[xx].src.indexOf("1.")>-1) document.images[xx].src = ino[x].src;
	}
	
// Produktvergleich Tabellenzellen Rollover

function pover(y,x)
	{
	if (is_nav4) return;
	if (y>0)
		{
		for (i=-1;i<50;i++)
			{
			if (document.getElementById("p"+y+"v"+i))
				{
				document.getElementById("p"+y+"v"+i).style.background="#FBEBAE";
				}
			}
		}
	if (x>0)
		{
		for (i=0;i<200;i++)
			{
			if (document.getElementById("p"+i+"v"+x))
				{
				document.getElementById("p"+i+"v"+x).style.background="#DDE1E6";
				}
			}
		}
	if ((x>0)*(y>0)) document.getElementById("p"+y+"v"+x).style.background="#F9E38E";
	}
	
function pout(y,x)
	{
	if (is_nav4) return;
	if (y>0)
		{
		for (i=-1;i<50;i++)
			{
			if (document.getElementById("p"+y+"v"+i))
				{
				document.getElementById("p"+y+"v"+i).style.background="none";
				}
			}
		}
	if (x>0)
		{
		for (i=0;i<200;i++)
			{
			if (document.getElementById("p"+i+"v"+x))
				{
				document.getElementById("p"+i+"v"+x).style.background="none";
				}
			}
		}
	if ((x>0)*(y>0)) document.getElementById("p"+y+"v"+x).style.background="none";
	}
	
// Wenn Fenster sehr klein, Frosch ausblenden

function getWindowWidth()
	{
	if ((is_nav)+(is_opera5up)) 
		{
		return window.innerWidth;
		}
	else
		{
		return document.body.clientWidth;
		}

	}
	
function getLayerStyleRef(layname)
	{
	if (document.getElementById(layname)) return document.getElementById(layname).style;
	return null;
	}

if (is_nav4) {vi='show';hi="hide"} else {vi='visible';hi="hidden";};

function showhideheader()
	{
	if (myload==1)
		{
		froschi=getLayerStyleRef("frosch");
		w=getWindowWidth();
		if (w<1300) froschi.visibility=hi; else froschi.visibility=vi;
		}
	setTimeout("showhideheader()",1000);
	}

showhideheader()

