//Netscape 4 Resize Fix
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//Fix Safari Zurück Button Bug
function safarifix_hl(){ 
if(navigator.userAgent.indexOf("Safari")>-1){
var jj=onload;if(jj){if(onunload==null){
document.body.setAttribute('onunload',jj);}}}
}


//NN4 stylesheet falls nicht Version 5
if(!document.getElementById){
document.write('<link rel="stylesheet" type="text/css" href="/files/$Sys[Domain_Folder]css/nc4.css">');
document.close();}

//handle table row highligthing
function zeilenhl(tb,cl){ 
 var g,i,x,gr;if(document.getElementById){g=document.getElementsByTagName("TABLE");
 for(x=0;x<g.length;x++){if(g[x].className&&g[x].className==tb){
 gr=g[x].getElementsByTagName("TR");if(gr){for(i=0;i<gr.length;i++){
 if(i>0){gr[i].onmouseover=function(){this.className=cl;};
 gr[i].onmouseout=function(){this.className='';};}}}}}}
}

//handle pop up windows
function infopop(a) { 
 document.tutpop = window.open(a,'theInfo','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,height=500,width=800');
 document.tutpop.focus();
}

function setztemenue()
{var i,d='',h="<sty"+"le type=\"text/css\">";var tA=navigator.userAgent.toLowerCase();
if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}
if(document.getElementById){for(i=1;i<10;i++){d+='ul ';h+="\n.sub ul "+d+"{display:none;}";}
document.write(h+"\n<"+"/sty"+"le>");}}setztemenue();

function bilde_menue()
{var i,x,g,theDiv,bb,theS,tA,theU,pp,lvl,tS,opn;tA=navigator.userAgent.toLowerCase();
if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}
document.tControl=new Array;opn='';
if(document.NMopener&&document.NMopener.length>5){opn=document.NMopener.split(",");}
if(document.getElementById){for(x=1;x<10;x++){theDiv=document.getElementById('navi'+x);
if(theDiv){if(theDiv.className&&theDiv.className.indexOf("snm")>-1){theS=theDiv.className.split('_');
if(theS.length&&theS.length>2){theDiv.NMprop=theS.slice(1);}
else{alert('Missing Menue Menu Props:'+theDiv.id);continue;}}
else{alert('Missing Menue Menu Props:'+theDiv.id);continue;}
theU=theDiv.getElementsByTagName("UL");
for(i=0;i<theU.length;i++)
{theU[i].nmdiv=theDiv.id;theU[i].tctrl=document.tControl.length;document.tControl[document.tControl.length]=theU[i];
if(i==0){}pp=theU[i].parentNode;lvl=0;while(pp){if(pp.tagName&&pp.tagName=="UL"){lvl++;}
if(pp.tagName&&pp.tagName=="DIV"){break;}pp=pp.parentNode;}theU[i].nmlvl=lvl;}theA=theDiv.getElementsByTagName("A");
for(i=0;i<theA.length;i++){theA[i].nmdiv=theDiv.id;
bb=getSub(theA[i]);theA[i].ulref=(bb!=null)?bb.tctrl:-1;
theA[i].aref=document.tControl.length;
document.tControl[document.tControl.length]=theA[i];if(theDiv.NMprop[2]==2){theA[i].onmouseover=function()
{timeMenue(this);};theA[i].onfocus=function(){timeMenue(this);};}
else{if(theA[i].ulref<0){theA[i].onclick=function(){toggleMenue(this);};}else{theA[i].onclick=function(){clickMenue(this);};}}}
if(theDiv.NMprop[1]==1){tS="'"+theDiv.id+"'";
for(i=0;i<opn.length;i+=3){if(opn[i]==theDiv.id){tS=tS+","+opn[i+1]+",'"+opn[i+2]+"'";}
break;}
eval("oeffnemenue("+tS+")");}}}
document.body.onmouseover=mainClose;}}

function getSub(a)
{var i,theU=null;var g=a.parentNode.getElementsByTagName("UL");
if(g&&g.length){theU=g[0];}return theU;}

function showMenue(ob,bp)
{var i,s,hh,thePc,mk;var g=document.getElementById(ob.nmdiv);
if(!bp&&g.NMprop[3]==1){toggleMenue(ob);}if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;
for(i=0;i<thePc.length;i++)
{if(thePc[i].tagName=="UL")
{if(thePc[i].style.display!="block"){thePc[i].style.display="block";ob.parentNode.style.position="relative";
if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7])){thePc[i].style.position="absolute";thePc[i].style.left=g.NMprop[4];
thePc[i].style.top=g.NMprop[5];}thePc[i].style.visibility="visible";
mk=(ob.className.indexOf("curr")>-1)?"minusmarkcurr":"minusmark";ob.className=mk;
if(g.NMprop[6]==1){animSub(thePc[i].tctrl,40);}}}}}}

function toggleMenue(a,b)
{var i,g,pp,theU,theA;if(a&&a.parentNode)
{pp=a.parentNode;while(pp)
{if(pp.tagName&&pp.tagName=="UL"){break;}pp=pp.parentNode;}
if(pp){theU=pp.getElementsByTagName("UL");g=document.getElementById(pp.nmdiv);
if(g.NMprop[0]==1&&b==1){return;}
for(i=0;i<theU.length;i++){theA=theU[i].parentNode.firstChild;if(b!=1&&theA==a){continue;}
else{if(theU[i].style.display=="block"){hideMenue(theA);}}}}}}

function hideMenue(ob)
{var i,s,hh,thePc,theIm,tt;var g=document.getElementById(ob.nmdiv);
if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;for(i=0;i<thePc.length;i++)
{if(thePc[i].tagName=="UL"){thePc[i].style.display="none";
if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7])){thePc[i].style.position="static";
thePc[i].style.left=0;thePc[i].style.top=0;}thePc[i].style.visibility="hidden";
mk=(ob.className.indexOf("curr")>-1)?"plusmarkcurr":"plusmark";
ob.className=mk;tt='setTimeout("dodo('+thePc[i].tctrl+')",1)';eval(tt);}}}}

function dodo(ct)
{var g=document.tControl[ct];g.parentNode.style.position="static";}

function animSub(ct,st)
{var g=document.tControl[ct];var sp=30;var inc=20;st=(st>=100)?100:st;g.style.fontSize=st+"%";
if(st<100){st+=inc;setTimeout("animSub("+ct+","+st+")",sp);}}

function clickMenue(a)
{document.nmactive=1;document.nmadiv=a.nmdiv;var i,s,thePc;if(a&&a.parentNode)
{thePc=a.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){s=thePc[i].style.display;
if(s=="block"){hideMenue(a);}
else{showMenue(a);}}}}}

function timeMenue(a)
{if(document.nmcc){clearTimeout(document.nmcc);}
document.nmactive=1;document.nmadiv=a.nmdiv;
var tg='document.nmcc=setTimeout("mouseMenue('+a.aref+')",220)';
eval(tg);}

function mouseMenue(ct)
{var g=document.tControl[ct];if(ct>=0)
{showMenue(g);}
else{toggleMenue(g);}}

function mainClose(evt)
{evt=(evt)?evt:((event)?event:null);
var nn,pp,m=true;
var st=document.nmactive;if(st!=-999)
{if(evt){var theSrc=(evt.target)?evt.target:evt.srcElement;pp=theSrc.parentNode;while(pp){nn=pp.nodeName;
if(nn=="DIV"&&pp.NMprop){m=false;document.nmactive=1;document.nmadiv=pp.id;pp.nmstate=1;break;}pp=pp.parentNode;}
if(m){document.nmactive=0;document.nmadiv='none';}
if(document.nmc){clearTimeout(document.nmc);}
document.nmc=setTimeout("schliessemenue()",300);}}}

function schliessemenue()
{var theA,i,divName,theDiv;if(document.nmadiv=='none')
{document.nmactive=-1;}
for(i=1;i<11;i++)
{divName='navi'+i;
theDiv=document.getElementById(divName);
if(theDiv){if(document.nmadiv!=theDiv.id){theDiv.nmstate==0;theA=theDiv.getElementsByTagName("A");
if(theA){toggleMenue(theA[0],1);}}}}}

//menüöffner
function oeffnemenue(navDiv,tp,vu)
{var i,d,ha,pp,m=false;
if(document.getElementById){d=document.getElementById(navDiv);
if(d){ha=d.getElementsByTagName("A");
if(tp==null||tp==0){vu=window.location.href;tp=0;}
for(i=0;i<ha.length;i++){if(ha[i].href){if(tp<=0){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}
if(tp==1){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}
if(tp==2){if(ha[i].firstChild){if(ha[i].firstChild.nodeValue==vu){m=true;break;}}}}}
if(m){pp=ha[i].parentNode;if(ha[i].ulref<0){ha[i].className="currentmark";pp=pp.parentNode;}while(pp)
{if(pp.nodeName=="LI")
{if(pp.firstChild.nodeName=="A"){pp.firstChild.className="plusmarkcurr";
if(d.NMprop[0]==1){showMenue(pp.firstChild,9);}}}pp=pp.parentNode;}}}}}


function setzte_reiheBS()
{var theBox="bildmenue";
var theShim="menuebild";
var theDiv="produktlinks";
var i,tB,tS,tD,tL,tA,j,np;
if(document.getElementById){tB=document.getElementById(theBox);
if(tB){tD=document.getElementById(theDiv);if(tD){tB.RBS=arguments;
if(document.RBSdn){tB.RBS[0]=document.RBSdn;}tL=tD.getElementsByTagName("LI");
if(tL){j=tL.length;
if(tB.RBS[0]==0){i=Math.floor(Math.random()*j);}
else{i=(tB.RBS[0]>j)?0:tB.RBS[0]-1;i=(i<0)?0:i;}tA=tL[i].getElementsByTagName("A");
if(tA&&tA.length>1){tB.style.backgroundImage="url("+tA[1].href+")";tS=document.getElementById(theShim);
if(tS){tS.setAttribute("alt",tA[0].firstChild.nodeValue);tS.parentNode.setAttribute("href",tA[0].href);}runRBS(tB.id,'Reset');}}}}}}

function scroll_Slideshow(ob,tT,np)
{if(document.getElementById){var theBox=document.getElementById(ob);
var tt,nu,tF,lp=0,hp=0,inc=0,dl=theBox.RBS[5],m=true;;
var tm="theBox.BGtm=setTimeout(\"scroll_Slideshow('";if(theBox){if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';
tF=theBox.RBS[4];theBox.RBSac+=tF;nu=theBox.RBSac+tF;
if(theBox.RBS[1]=='C')
{if(nu>theBox.RBS[6]&&theBox.RBSac!=theBox.RBS[6])
{tF=theBox.RBS[6]-theBox.RBSac;theBox.RBSac=theBox.RBS[6]-theBox.RBS[4];}
if(theBox.RBSac>=theBox.RBS[6])
{dl=theBox.RBS[7];theBox.RBSac=0;theBox.RBSc+=1;
if(theBox.RBSc>theBox.RBScc){theBox.RBSc=1;}}}
theBox.RBSae+=tF;inc=(np>=0)?tF:tF*-1;np=np+inc;
if(theBox.RBSae+tF>theBox.RBS[9]){np=(np>=0)?theBox.RBS[9]:theBox.RBS[9]*-1;}
tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.RBSres=tm;if(theBox.RBS[3]=="N"&&theBox.RBSae>theBox.RBS[9]){m=false;theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}}if(m){if(theBox.RBScm==1){eval(tm);}}}}}function runRBS(ob,cm,op){var lp=0,hp=0,tT,tm,dl;var tm="theBox.BGtm=setTimeout(\"scroll_Slideshow('";if(document.getElementById){var theBox=document.getElementById(ob);if(theBox){if(cm=='Stop'){theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}}if(cm=='Resume'){theBox.RBScm=1;if(theBox.RBSres){eval(theBox.RBSres);}}if(cm=='Reset'){theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}theBox.RBSres='';np=theBox.RBS[8];theBox.RBSac=0;theBox.RBSae=0;var tT="H";if(theBox.RBS[2]=='U'||theBox.RBS[2]=='D'){tT="V";}if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';np+=theBox.RBS[4];if(theBox.RBS[2]=="L"||theBox.BGs[2]=="U"){np=np*-1;}theBox.RBSc=1;theBox.RBScc=parseInt(theBox.RBS[9]/theBox.RBS[6]);theBox.RBScm=1;dl=(op)?op:theBox.RBS[7];tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.RBSres=tm;if(theBox.RBS[10]=="Y"){eval(tm);}}}}}

function formclear(el) {//braucht der IE um die Formularfelder zu leeren
  if (el.defaultValue==el.value) el.value = ""
}
