/* // "bretteleben.de Simple Picture Slideshow" Plugin for Joomla 1.5 - Version 1.5.5 // License: GNU General Public License version 2 or later; see LICENSE.txt // Author: Andreas Berger - andreas_berger@bretteleben.de // Copyright (C) 2011 Andreas Berger - http://www.bretteleben.de. All rights reserved. // Project page and Demo at http://www.bretteleben.de // ***Last update: 2011-01-11*** */ function besps_slideshow(besps_slideid,besps_ftim,besps_stim,besps_steps,besps_startwhen,besps_emax,besps_caps,besps_preload){ //declarations var self = this; var slideid=besps_slideid; var ftim=besps_ftim; var stim=besps_stim; var steps=besps_steps; var startwhen=besps_startwhen; var emax=besps_emax; var preload=besps_preload; var stopit=1; var startim=1; var u=0; var parr = new Array(); var ptofade,pnext,factor,mytimeout; var caps=besps_caps; //daisychain onload-events this.be_daisychain=function(sl){ if(window.addEventListener){ window.addEventListener('load',sl,false); } else if(window.attachEvent){ window.attachEvent('onload',sl); } else{ if(window.onload){ var ld=window.onload; window.onload=function(){ld();sl();}; } else{ window.onload=sl; } } }; //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(preload&&a==emax){ setTimeout(function(){self.b_preload();},10); } } 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=2){startim=startim-1;} else{startim=emax;} this.b_switchcap(); self.b_slide(); } else{ //whilst sliding this.b_switchcap(); self.b_slide(); } //counter self.setCurrentNumber(); } //slide as said, then give back this.b_slidenow = function(){ var check1,maxalpha,curralpha; 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=1){ for (j=0;j=1){ document.getElementById("bs_caps_"+besps_slideid).getElementsByTagName("div")[0].innerHTML=(caps[startim-1][0]!=""||caps[startim-1][1]!="")?""+caps[startim-1][0]+""+caps[startim-1][1]+"":" "; } } //counter this.setCurrentNumber= function(){ if(document.getElementById("besps_counter_"+besps_slideid)){ var actim=startim; var lastim=emax; //capture doubled arrays if(parr.length==4&&parr[1].getElementsByTagName("img")[0].src==parr[3].getElementsByTagName("img")[0].src){ lastim=2; actim-=(actim>=3)?2:0; } if(emax>=10){actim=(actim<=9)?('0'+actim):(actim);} if(emax>=100){actim=(actim<=99)?('0'+actim):(actim);} document.getElementById("besps_counter_"+besps_slideid).innerHTML=actim+"/"+lastim; } } //call autostart-function this.be_daisychain(this.b_myfade); }