/*
	Copyright 2008/2009 by Edy Muellers opuskula 
	
	Dieser Code darf nur fuer die Domain fedierdesign.ch verwendet werden.
	Jeglich Modifikation ist verboten.
*/

function opEchoCSSfix(){document.write ('<link href="/g/css/extra.css.php?b='+opWW()+'&h='+opWH()+'" rel="stylesheet" type="text/css" media="screen" />');}
function opStart(){var i;var opImg=new Array;if(typeof opIpArray != 'undefined'){for(i=0;i<opIpArray.length;i++){opImg[i]=new Image;opImg[i].src=opIpArray[i];}}}
function mausArbeitOver(t){document.getElementById("opKunde").innerHTML=t;}
function mausArbeitOut(){var i;document.getElementById("opKunde").innerHTML='&nbsp;';}
var opAktPos=0;var opMoving=false;var opMoveStep=0;var opScrollPause=100;
if(typeof opScrollStartPos!='undefined'){opAktPos = opScrollStartPos;}
function opScrollInit(){opAktPos = opScrollStartPos;}
function opScroll(r){if (typeof opScrollStartPos=='undefined'){return;}if(opMoving==true ){return;}
if(opAktPos>=opScrollStartPos && r==1){return;}
if(opAktPos<=opScrollEndPos && r==-1){return;}opMoving=true;opMoveStep=r*17;
window.setTimeout("opScrollWeiter()", opScrollPause+1);}
function opScrollStop(){opMoving=false;}
function opScrollWeiter(){var div = document.getElementById('layScroll');
if(opMoving==false){return;}
var np = opAktPos + opMoveStep;
document.getElementById('layScroll').style.top=np+"px";
opAktPos = np;
if( opAktPos<opScrollStartPos && opAktPos>opScrollEndPos ){window.setTimeout("opScrollWeiter()", opScrollPause);}}
function opDisplayElement(l,w){ //V 1.0 (C) 2008 opuskula.ch
document.getElementById(l).style.display=w;}
function opScrollrad(event){var delta = 0;
if(!event){event = window.event;}
if(event.wheelDelta){delta = event.wheelDelta/120;
if(window.opera){delta = -delta;}} else if(event.detail){delta = -event.detail/3;}
if(delta){ 
if(delta < 0){opScroll(-1);
window.setTimeout("opScrollStop()", 8*opScrollPause+1);} else{opScroll(1);
window.setTimeout("opScrollStop()", 8*opScrollPause+1);}}}
if(window.addEventListener){window.addEventListener('DOMMouseScroll', opScrollrad, false);}
window.onmousewheel = document.onmousewheel = opScrollrad;
sdr = document.documentElement.clientHeight*0.15;
function setsdr(){sdr = document.documentElement.clientHeight*0.15;}
window.onload = setsdr;
window.onresize = setsdr;
function opMarkEgoStyle(a){ //V 1.0 (C) 2008 opuskula.ch
var as=document.getElementsByTagName("a"),b=document.location,i,c;for(i=0;i<as.length;i++){c=as[i].getAttribute('href');if(b==opRel2Abs(c)){as[i].setAttribute('style',a);}}}
function opRel2Abs(r){ //V 1.0 (C) 2008 opuskula.ch
var s=document.location+"",t,u;t=s.split('/');t.pop();if(r==null||typeof r=='undefined')r='';u=r.split('/');if(u[0]=='')return( t.join('/')+'/'+r);for(var i=0;i<u.length;i++){switch(u[i]){case'.':break;case '..':t.pop();break;default:t.push(u[i]);}}return t.join('/');}
function opWW(){if(window.innerWidth){return window.innerWidth;}else if(document.body&&document.body.offsetWidth){return document.documentElement.offsetWidth;}else{return document.documentElement.offsetWidth;}}
function opWH(){if(window.innerHeight){return window.innerHeight;}else if(document.body&&document.body.offsetHeight){return document.documentElement.offsetHeight;}else{return document.documentElement.offsetHeight;}}

