﻿/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/




//fadeimages[2]=["images/photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax

/*
 
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
*/
 
var sbofanclubfadebgcolor="FFFBD0"
 
////NO need to edit beyond here/////////////
 
var sbofanclubfadearray=new Array() //array to cache sbofanclubfadeshow instances
var sbofanclubfadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function sbofanclubfadeshow(sbofanclubtheimages, sbofanclubfadewidth, sbofanclubfadeheight, sbofanclubborderwidth, sbofanclubdelay, sbofanclubpause, sbofanclubdisplayorder){
this.sbofanclubpausecheck=sbofanclubpause
this.mouseovercheck=0
this.sbofanclubdelay=sbofanclubdelay
this.sbofanclubdegree=10 //initial opacity sbofanclubdegree (10%)
this.sbofanclubcurimageindex=0
this.sbofanclubnextimageindex=1
sbofanclubfadearray[sbofanclubfadearray.length]=this
this.sbofanclubslideshowid=sbofanclubfadearray.length-1
this.sbofanclubcanvasbase="sbofanclubcanvas"+this.sbofanclubslideshowid
this.sbofanclubcurcanvas=this.sbofanclubcanvasbase+"_0"
if (typeof sbofanclubdisplayorder!="undefined")
sbofanclubtheimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.sbofanclubtheimages=sbofanclubtheimages
this.sbofanclubimageborder=parseInt(sbofanclubborderwidth)
this.sbofanclubpostimages=new Array() //preload images
for (p=0;p<sbofanclubtheimages.length;p++){
this.sbofanclubpostimages[p]=new Image()
this.sbofanclubpostimages[p].src=sbofanclubtheimages[p][0]
}
 
var sbofanclubfadewidth=sbofanclubfadewidth+this.sbofanclubimageborder*2
var sbofanclubfadeheight=sbofanclubfadeheight+this.sbofanclubimageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.sbofanclubslideshowid+'" style="position:relative;width:'+sbofanclubfadewidth+'px;height:'+sbofanclubfadeheight+'px;overflow:hidden;"><div id="'+this.sbofanclubcanvasbase+'_0" style="position:absolute;width:'+sbofanclubfadewidth+'px;height:'+sbofanclubfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+sbofanclubfadebgcolor+'"></div><div id="'+this.sbofanclubcanvasbase+'_1" style="position:absolute;width:'+sbofanclubfadewidth+'px;height:'+sbofanclubfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+sbofanclubfadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.sbofanclubslideshowid+'" src="'+this.sbofanclubpostimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.sbofanclubcurimageindex++
setInterval("sbofanclubfadearray["+this.sbofanclubslideshowid+"].rotateimage()", this.sbofanclubdelay)
}
}

function sbofanclubfadepic(obj){
if (obj.sbofanclubdegree<100){
obj.sbofanclubdegree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.sbofanclubdegree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.sbofanclubdegree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.sbofanclubdegree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.sbofanclubdegree/100
}
else{
clearInterval(sbofanclubfadeclear[obj.sbofanclubslideshowid])
obj.nextcanvas=(obj.sbofanclubcurcanvas==obj.sbofanclubcanvasbase+"_0")? obj.sbofanclubcanvasbase+"_0" : obj.sbofanclubcanvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.sbofanclubnextimageindex)
obj.sbofanclubnextimageindex=(obj.sbofanclubnextimageindex<obj.sbofanclubpostimages.length-1)? obj.sbofanclubnextimageindex+1 : 0
setTimeout("sbofanclubfadearray["+obj.sbofanclubslideshowid+"].rotateimage()", obj.sbofanclubdelay)
}
}
 
sbofanclubfadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.sbofanclubtheimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.sbofanclubtheimages[picindex][1]+'" target="'+this.sbofanclubtheimages[picindex][2]+'">'
slideHTML+='<img src="'+this.sbofanclubpostimages[picindex].src+'" border="'+this.sbofanclubimageborder+'px">'
if (this.sbofanclubtheimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
sbofanclubfadeshow.prototype.rotateimage=function(){
if (this.sbofanclubpausecheck==1) //if sbofanclubpause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.sbofanclubcurcanvas] : document.getElementById(this.sbofanclubcurcanvas)
crossobj.style.zIndex++
sbofanclubfadeclear[this.sbofanclubslideshowid]=setInterval("sbofanclubfadepic(sbofanclubfadearray["+this.sbofanclubslideshowid+"])",50)
this.sbofanclubcurcanvas=(this.sbofanclubcurcanvas==this.sbofanclubcanvasbase+"_0")? this.sbofanclubcanvasbase+"_1" : this.sbofanclubcanvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.sbofanclubslideshowid]
ns4imgobj.src=this.sbofanclubpostimages[this.sbofanclubcurimageindex].src
}
this.sbofanclubcurimageindex=(this.sbofanclubcurimageindex<this.sbofanclubpostimages.length-1)? this.sbofanclubcurimageindex+1 : 0
}
 
sbofanclubfadeshow.prototype.resetit=function(){
this.sbofanclubdegree=10
var crossobj=iebrowser? iebrowser[this.sbofanclubcurcanvas] : document.getElementById(this.sbofanclubcurcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.sbofanclubdegree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.sbofanclubdegree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.sbofanclubdegree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.sbofanclubdegree/100
}
 
 
sbofanclubfadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.sbofanclubcurcanvas] : document.getElementById(this.sbofanclubcurcanvas)
this.populateslide(crossobj, this.sbofanclubcurimageindex)
if (this.sbofanclubpausecheck==1){ //IF SLIDESHOW SHOULD sbofanclubpause ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.sbofanclubslideshowid] : document.getElementById("master"+this.sbofanclubslideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
 

