/**************************************************************** "bretteleben.de JavaScript Slideshow" - Version 20100412 License: http://www.gnu.org/copyleft/gpl.html Author: Andreas Berger Copyright (c) 2010 Andreas Berger - andreas_berger@bretteleben.de Project page and Demo at http://www.bretteleben.de Last update: 2012-02-29 (modified by P. Osiak - http://www.vetmed.fu-berlin.de/einrichtungen/zentrale/bibliothek) *****************************************************************/ //*****parameters to set***** //into this array insert the paths of your pics. var def_imges=['http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we07/we07_01.jpg', 'http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we07/we07_02.jpg', 'http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we07/we07_03.jpg']; var def_captions=['', '', 'Das Robert-von-Ostertag-Haus, künftiges Institutsgebäude']; var def_captions_en=['', '', '']; var def_divid="slideshow"; //the id of the div container that will hold the slideshow var def_picwid=240; //set this to the width of your widest pic var def_pichei=180; //... and this to the height of your highest pic var def_contrbackgr="#99CC00"; // background color of the control panel var def_backgr="#eeeeee"; //set this to the background color you want to use for the slide-area //(for example the body-background-color) if your pics are of different size var def_sdur=6; //time to show a pic between fades in seconds var def_fdur=0.5; //duration of the complete fade in seconds var def_steps=20; //steps to fade from on pic to the next var def_startwhen="y"; //start automatically at pageload? set it to "y" for on and to "n" for off var def_shuffle="n"; //start with random image? set it to "y" for on and to "n" for off var def_showcontr="y"; //do you want to show controls? set it to "y" for on and to "n" for off //into this array insert the paths of your control-buttons or the text to display e.g. back,start,stop,fwrd. var def_contr=['http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we03/bwd.png', 'http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we03/start.png', 'http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we03/stop.png', 'http://www.vetmed.fu-berlin.de/einrichtungen/weprofil/we03/fwd.png']; //**************************************************************** //daisychain onload-b function daisychain(sl){if(window.onload) {var ld=window.onload;window.onload=function(){ld();sl();};}else{window.onload=function(){sl();};}} function be_slideshow(be_en,be_slideid,be_imges,be_captions,be_divid,be_picwid,be_pichei,be_contrbackgr,be_backgr,be_sdur,be_fdur,be_steps,be_startwhen,be_shuffle,be_showcontr,be_contr){ //declarations and defaults var en=(be_en)?be_en:"false"; var slideid=(be_slideid)?be_slideid:"0"; var imges=(be_imges)?be_imges:def_imges; if (en == true) { var captions=(be_captions)?be_captions:def_captions_en; } else { var captions=(be_captions)?be_captions:def_captions; } var divid=(be_divid)?be_divid:def_divid; var picwid=(be_picwid)?be_picwid:def_picwid; var pichei=(be_pichei)?be_pichei:def_pichei; var contrbackgr=(be_contrbackgr)?be_contrbackgr:def_contrbackgr; var backgr=(be_backgr)?be_backgr:def_backgr; var sdur=(be_sdur)?be_sdur:def_sdur; var fdur=(be_fdur)?be_fdur:def_fdur; var steps=(be_steps)?be_steps:def_steps; var startwhen=(be_startwhen)?be_startwhen:def_startwhen; startwhen=(startwhen.toLowerCase()=="y")?1:0; var shuffle=(be_shuffle)?be_shuffle:def_shuffle; shuffle=(shuffle.toLowerCase()=="y")?1:0; var showcontr=(be_showcontr)?be_showcontr:def_showcontr; showcontr=(showcontr.toLowerCase()=="y")?1:0; var contr=(be_contr)?be_contr:def_contr; var ftim=fdur*1000/steps; var stim=sdur*1000; var emax=imges.length; var self = this; var stopit=1; var startim=1; var u=0; var parr = new Array(); var ptofade,pnext,factor,mytimeout; //check if there are at least 3 pictures, elswhere double the array if(imges.length<=2){imges=imges.concat(imges);} //shuffle images if set if(shuffle){var i;for(i=0;i<=Math.floor(Math.random()*imges.length);i++){imges.push(imges.shift());}} //push images into array and get things going this.b_myfade = function(){ var a,idakt,paktidakt,ie5exep; for(a=1;a<=emax;a++){ idakt="img_"+slideid+"_"+a;paktidakt=document.getElementById(idakt); ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep); } if(startwhen){ stopit=0; mytimeout=setTimeout(function(){self.b_slide();},stim); } } //prepare current and next and trigger slide this.b_slide = function(){ clearTimeout(mytimeout); u=0; ptofade=parr[startim-1]; if(startim 0){this.b_slide();ptofade.style.zIndex=1;pnext.style.zIndex=2;startim++;} document.getElementById("startbtn").style.display = 'inline'; document.getElementById("stopbtn").style.display = 'none'; } //insert css and images this.b_insert= function(){ var b, thestylid, thez, thevis, slidehei; slidehei=(showcontr)?(pichei+26):(pichei); //add space for the controls var myhtml="
"; myhtml+="
"; for(b=1;b<=emax;b++){ thez=1;thevis='hidden'; if(b<=1) {thez=2; thevis='visible';} myhtml+="
"; myhtml+=""; myhtml += "
"; myhtml += "

"+captions[(b-1)]+"

"; myhtml += "

"+b+"/"+emax+"

"; myhtml += "
"; } myhtml+="
"; //show controls if(showcontr){ for(b=1;b<=4;b++){ var check=contr[b-1].substring(contr[b-1].length-3).toLowerCase(); //check for buttons contr[b-1]=(check=="jpg"||check=="gif"||check=="png")?(""):(contr[b-1]); } myhtml+="
"; if(en == true) { myhtml+="
IMPRESSIONS
"; } else { myhtml+="
IMPRESSIONEN
"; } myhtml+="
"; myhtml+=""+contr[0]+" "; myhtml+=""+contr[3]+" "; myhtml+=""; myhtml+=""+contr[2]+" "; myhtml+="
"; } myhtml+="
"; document.getElementById(divid).innerHTML=myhtml; self.b_myfade(); } //call autostart-function daisychain(this.b_insert); } // Ueberpruefen ob in dem Script-Text "en" enthalten ist, falls ja, englische Version ausgeben var scripts = document.getElementsByTagName('script'); var myScript = scripts[scripts.length - 1]; if (myScript.innerHTML.indexOf("en") != -1) { var be_0= new be_slideshow(true); } else { var be_0= new be_slideshow(); }