//Random Transitions Slideshow- By JavaScript Kit (http://www.javascriptkit.com) //Created: Nov 3rd, 2008 var global_transitions=[ //array of IE transition strings "progid:DXImageTransform.Microsoft.Barn()", "progid:DXImageTransform.Microsoft.Blinds()", "progid:DXImageTransform.Microsoft.CheckerBoard()", "progid:DXImageTransform.Microsoft.Fade()", "progid:DXImageTransform.Microsoft.GradientWipe()", "progid:DXImageTransform.Microsoft.Inset()", "progid:DXImageTransform.Microsoft.Iris()", "progid:DXImageTransform.Microsoft.Pixelate(maxSquare=15)", "progid:DXImageTransform.Microsoft.RadialWipe()", "progid:DXImageTransform.Microsoft.RandomBars()", "progid:DXImageTransform.Microsoft.RandomDissolve()", "progid:DXImageTransform.Microsoft.Slide()", "progid:DXImageTransform.Microsoft.Spiral()", "progid:DXImageTransform.Microsoft.Stretch()", "progid:DXImageTransform.Microsoft.Strips()", "progid:DXImageTransform.Microsoft.Wheel()", "progid:DXImageTransform.Microsoft.Zigzag()" ] function flashyslideshow(setting){ this.wrapperid=setting.wrapperid this.imagearray=setting.imagearray this.pause=setting.pause this.transduration=setting.transduration/1000 //convert from miliseconds to seconds unit to pass into el.filters.play() this.currentimg=0 this.transitionindex=setting.transitionindex var preloadimages=[] //temp array to preload images for (var i=0; i
'+this.getSlideHTML(this.currentimg)+'
') //var effectindex=Math.floor(Math.random()*global_transitions.length) //randomly pick a transition to utilize var effectindex=-1 if (this.transitionindex>0 && this.transitionindex<17) { effectindex=this.transitionindex } else if (this.transitionindex==17) { effectindex=Math.floor(Math.random()*global_transitions.length) //randomly pick a transition to utilize } else { //set to a not existing value -> will cause no effect effectindex=100 } var contentdiv=document.getElementById(this.wrapperid+"_inner") if (contentdiv.filters && effectindex!=100 && effectindex!=-1){ //if the filters[] collection is defined on element (only in IE) contentdiv.style.filter=global_transitions[effectindex] //define transition on element this.pause+=setting.transduration //add transition time to pause } else { this.pause=this.pause*2 this.pause+=setting.transduration //add transition time to pause also in case of not IE } this.filtersupport=(contentdiv.filters && contentdiv.filters.length>0)? true : false //test if element supports transitions and has one defined var slideshow=this flashyslideshow.addEvent(contentdiv, function(){slideshow.isMouseover=1}, "mouseover") flashyslideshow.addEvent(contentdiv, function(){slideshow.isMouseover=0}, "mouseout") setInterval(function(){slideshow.rotate()}, this.pause) } flashyslideshow.addEvent=function(target, functionref, tasktype){ if (target.addEventListener) target.addEventListener(tasktype, functionref, false); else if (target.attachEvent) target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)}); }, flashyslideshow.setopacity=function(el, degree){ //sets opacity of an element (FF and non IE browsers only) if (typeof el.style.opacity!="undefined") el.style.opacity=degree else el.style.MozOpacity=degree el.currentopacity=degree }, flashyslideshow.prototype.getSlideHTML=function(index){ var slideHTML="" slideHTML+=this.imagearray[index][0] return slideHTML //return HTML for the slide at the specified index } flashyslideshow.prototype.rotate=function(){ var contentdiv=document.getElementById(this.wrapperid+"_inner") if (this.isMouseover){ //if mouse is over slideshow return } this.currentimg=(this.currentimg