/****************************************************************
"bretteleben.de JavaScript Slideshow" - Version 20081101
License: http://www.gnu.org/copyleft/gpl.html
Author: Andreas Berger
Copyright (c) 2008 Andreas Berger - andreas_berger@bretteleben.de
Project page and Demo at http://www.bretteleben.de
Last update: 2008-11-01
*****************************************************************/
//*****erforderliche parameter*****
//array mit den pfaden zu den bildern
//bei nur zwei bildern, diese bitte zweimal angeben i.e.: 1/2/1/2
imges=new Array ('custom/module/public/rettig/images/fz1_neu.jpg', 'custom/module/public/rettig/images/bestanden1.jpg', 'custom/module/public/rettig/images/fz2_neu.jpg', 'custom/module/public/rettig/images/bestanden2.jpg', 'custom/module/public/rettig/images/fz13_bmw1er.jpg', 'custom/module/public/rettig/images/bestanden3.jpg', 'custom/module/public/rettig/images/slider_pic1.jpg', 'custom/module/public/rettig/images/bestanden4.jpg', 'custom/module/public/rettig/images/fz3_neu.jpg', 'custom/module/public/rettig/images/bestanden5.jpg', 'custom/module/public/rettig/images/fz4_neu.jpg', 'custom/module/public/rettig/images/bestanden6.jpg', 'custom/module/public/rettig/images/fz5_neu.jpg', 'custom/module/public/rettig/images/bestanden7.jpg', 'custom/module/public/rettig/images/slider_pic2.jpg', 'custom/module/public/rettig/images/fz6_neu.jpg', 'custom/module/public/rettig/images/bestanden8.jpg', 'custom/module/public/rettig/images/fz7_neu.jpg', 'custom/module/public/rettig/images/fz8_neu.jpg', 'custom/module/public/rettig/images/slider_pic3.jpg', 'custom/module/public/rettig/images/fz9_neu.jpg', 'custom/module/public/rettig/images/fz10_neu.jpg', 'custom/module/public/rettig/images/fz8.jpg', 'custom/module/public/rettig/images/slider_pic4.jpg', 'custom/module/public/rettig/images/fz9.jpg', 'custom/module/public/rettig/images/fz10.jpg', 'custom/module/public/rettig/images/fz11.jpg');
divid="slideshow"; //the id of the div container that will hold the slideshow
picwid=239; //breite des breitesten bildes in pixel
pichei=145; //h&ouml;he des h&ouml;chsten bildes in pixel
backgr="#eeeeee"; //hintergrundfarbe der slideshow, falls verschieden grosse oder transparente bilder
//verwendet werden, kann hier z.B. die hintergrundfarbe der seite gesetzt werden
sdur=2; //zeit zwischen den wechseln (&uuml;berblendung) in sekunden
fdur=1; //dauer des &uuml;bergangs (&uuml;berblendung) in sekunden
steps=25; //schritte in denen &uuml;berblendet wird (je mehr dest sanfter)
startwhen=1;
// "startwhen" bleibt "null" wenn das script von der seite z.B. per link gestartet wird
//(beispiel: <a href="javascript:myfade();">slide</a>)
// oder wird auf 1 gesetzt, damit das script beim laden der seite automatisch startet
//das wars auch schon, viel spass :)
//mit einem zuf&auml;lligen bild starten: for(i=0;i<=Math.floor(Math.random()*imges.length);i++){imges.push(imges.shift());}
//****************************************************************
ftim=fdur*1000/steps;stim=sdur*1000;emax=imges.length;
tp="<div style='position:absolute;'>";
for(e=1;e<=emax;e++){
  theid="img"+e;thesrc=imges[e-1];
  tp=tp+"<div id='"+theid+"'><img src='"+thesrc+"' border='0'/></div>";
  }
tp=tp+"</div>";
document.write("<style type='text/css'>");
for(b=1;b<=emax;b++){
  thestylid="img"+b;thez=1;thevis='hidden';
  if(b<=1) {thez=2; thevis='visible';}
  document.write("#"+thestylid+" {position:absolute;left:0;top:0;width:"+picwid+"px;height:"+pichei+"px;background-color:"+backgr+";visibility:"+thevis+";z-index:"+thez+";}");
  }
document.write("</style>");
function myfade(){
  parr = new Array();
  for(a=1;a<=emax;a++){
    idakt="img"+a;paktidakt=document.getElementById(idakt);
    ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep);}
    i=1;u=0;slide (i);
    }
function slide(numa){
  ptofade=parr[numa-1];
  if(numa<=emax){pnext=parr[numa];}
  if(numa==emax){pnext=parr[0];}
  pnext.style.visibility="visible";
  pnext.style.filter="Alpha(Opacity=100)";
  pnext.style.MozOpacity=1;
  pnext.style.opacity=1;
  ptofade.style.filter="Alpha(Opacity=100)";
  ptofade.style.MozOpacity=1;
  ptofade.style.opacity=1;
  factor=100/steps;
  slidenow();
  }
function slidenow(){
  check1=ptofade.style.MozOpacity;
  maxalpha=(100-factor*u)/100*105;
  if(check1<=maxalpha/100){u=u+1;}
  curralpha=100-factor*u;
  ptofade.style.filter="Alpha(Opacity="+curralpha+")";
  ptofade.style.MozOpacity=curralpha/100;
  ptofade.style.opacity=curralpha/100;
  if(u<steps){window.setTimeout("slidenow()",ftim);}
  if(u>=steps&&i<emax){
    ptofade.style.visibility="hidden";
    ptofade.style.zIndex=1;
    pnext.style.zIndex=2;
    i=i+1;u=0;
    window.setTimeout("slide(i)",stim);}
  if(u>=steps&&i>=emax){
    ptofade.style.visibility="hidden";
    ptofade.style.zIndex=1;
    pnext.style.zIndex=2;
    i=1;u=0;
    window.setTimeout("slide(i)",stim);}
  }
function shownow(){
  document.getElementById(divid).innerHTML=tp;
  if(startwhen){window.setTimeout("myfade()",stim);}
  }
onload=shownow;
