var hintergrund = "#fff";

//// BROWSERABFRAGE
var ie4 = ((document.all) && (navigator.appVersion.indexOf('MSIE 4')!=-1)) ? true:false;
var ie5 = ((document.getElementById) && (navigator.appVersion.indexOf('MSIE 5')!=-1)) ? true:false;
var ie6 = ((document.getElementById) && (navigator.appVersion.indexOf('MSIE 6')!=-1)) ? true:false;
var ie7 = ((document.getElementById) && (navigator.appVersion.indexOf('MSIE 7')!=-1)) ? true:false;
var ns4 = ((document.layers) && (navigator.appVersion.indexOf('4')!=-1))? true:false;
var ns6 = ((document.getElementById) && (navigator.appName == 'Netscape')) ? true:false;
var opera = (navigator.appName == 'Opera') ? true:false;
var LayerAktiv = false;


//  FARBE ÄNDERN
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();

}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}

var backColor = new Array();

backColor[0] = '#ffffff';
backColor[1] = '#414141';
backColor[2] = '#000000';


function changeBG(whichColor){
document.body.style.backgroundColor = backColor[whichColor];
document.getElementById("menu").style.backgroundColor = backColor[whichColor];
document.getElementById("submen").style.backgroundColor = backColor[whichColor];
//document.getElementById("submenuebersicht").style.backgroundColor = backColor[whichColor];
createCookie('backColor', whichColor, 300);
}

function aendern()
{
document.write('<style type="text/css">body {background-color: ' + backColor[readCookie("backColor")] + ';}<\/style>');
document.write('<style type="text/css">#menu {background-color: ' + backColor[readCookie("backColor")] + ';}<\/style>');
document.write('<style type="text/css">#submen {background-color: ' + backColor[readCookie("backColor")] + ';}<\/style>');

}
/*document.menu.style.backgroundColor = backColor[whichColor];
document.submenu.style.backgroundColor = backColor[whichColor];
/document.submenu.style.backgroundColor = backColor[whichColor];

if (document.all && !document.getElementById) // IE 4
{
document.all['menu'].style.backgroundColor=backColor[whichColor];
document.all['submen'].style.backgroundColor=backColor[whichColor];
document.all.style.backgroundColor=backColor[whichColor];}
if (document.getElementById) // IE 5.x und NN 6
{
document.getElementById("menu").style.backgroundColor=backColor[whichColor];
document.getElementById("submen").style.backgroundColor=backColor[whichColor];
document.body.style.backgroundColor=backColor[whichColor];
}
createCookie('backColor', whichColor, 300);
alert(whichColor);
}

function aendern(whichColor) {
document.write('<style type="text/css">body {background-color: ' + backColor[readCookie("backColor")] + ';}<\/style>');
document.getElementById("menu").style.backgroundColor = backColor[whichColor];
/*if (document.all && !document.getElementById) // IE 4
{
document.all['menu'].style.backgroundColor=hintergrund;
document.all['submen'].style.backgroundColor=hintergrund;
document.all.style.backgroundColor=hintergrund;}
if (document.getElementById) // IE 5.x und NN 6
{
document.getElementById("menu").style.backgroundColor=hintergrund;
document.getElementById("submen").style.backgroundColor=hintergrund;
document.body.style.backgroundColor=hintergrund;
}
alert(hintergrund);*/



//   ******* POSITION ÄNDERN
function posi(wer,t)
 {
         if ((ns6)||(ie5)||(ie6)||(ie7)||(opera))
       { document.getElementById(wer).style.top=t;}
    if (ns4)
       { document.layers[ wer ].top=t;}
    if (ie4)
       { document.all[ wer ].style.top=t;}
   }


//   ******* BILDER ANZEIGEN
function ShowHide(divid,n)  //wenn n=0 ->unsichtbar    ;wenn n=1 ->sichtbar
 {  if(n ==1)
         {
         if ((ns6)||(ie5)||(ie6)||(ie7)||(opera))
       { document.getElementById(divid).style.visibility="visible";}
    if (ns4)
       { document.layers[ divid ].visibility="visible";}
    if (ie4)
       { document.all[ divid ].style.visibility="visible";}
    }
 else
         {if ((ns6)||(ie5)||(ie6)||(ie7)||(opera))
       { document.getElementById(divid).style.visibility="hidden";}
    if (ns4)
       { document.layers[ divid ].visibility="hidden";}
    if (ie4)
       { document.all[ divid ].style.visibility="hidden";}
}
}



//   ******* BILDER AKTIVIEREN
        function imgOn(imgName) {
                if (isDOM) {
                //alert('dom');
                document.getElementById(imgName).src = eval(imgName+"on.src");
                } else {
                //alert('nodom');
                document[imgName].src=eval(imgName+"on.src");
                }
        }

//   ******* BILDER DEAKTIVIEREN
        function imgOff(imgName) {
                if (isDOM) {
                document.getElementById(imgName).src = eval(imgName+"off.src");
                } else {
                document[imgName].src=eval(imgName+"off.src");
                }
        }

//   ******* BILDERWECHSEL
function changer(imgid, imgurl)
{
        eval('document.images.' + imgid + '.src = "' + imgurl + '"');
}