﻿/***********************************************
* 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 fanclubfadebgcolor="FFFBD0"
 
////NO need to edit beyond here/////////////
 
var fanclubfadearray=new Array() //array to cache fanclubfadeshow instances
var fanclubfadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fanclubfadeshow(fanclubtheimages, fanclubfadewidth, fanclubfadeheight, fanclubborderwidth, fanclubdelay, fanclubpause, fanclubdisplayorder){
this.fanclubpausecheck=fanclubpause
this.mouseovercheck=0
this.fanclubdelay=fanclubdelay
this.fanclubdegree=10 //initial opacity fanclubdegree (10%)
this.fanclubcurimageindex=0
this.fanclubnextimageindex=1
fanclubfadearray[fanclubfadearray.length]=this
this.fanclubslideshowid=fanclubfadearray.length-1
this.fanclubcanvasbase="fanclubcanvas"+this.fanclubslideshowid
this.fanclubcurcanvas=this.fanclubcanvasbase+"_0"
if (typeof fanclubdisplayorder!="undefined")
fanclubtheimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.fanclubtheimages=fanclubtheimages
this.fanclubimageborder=parseInt(fanclubborderwidth)
this.fanclubpostimages=new Array() //preload images
for (p=0;p<fanclubtheimages.length;p++){
this.fanclubpostimages[p]=new Image()
this.fanclubpostimages[p].src=fanclubtheimages[p][0]
}
 
var fanclubfadewidth=fanclubfadewidth+this.fanclubimageborder*2
var fanclubfadeheight=fanclubfadeheight+this.fanclubimageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.fanclubslideshowid+'" style="position:relative;width:'+fanclubfadewidth+'px;height:'+fanclubfadeheight+'px;overflow:hidden;"><div id="'+this.fanclubcanvasbase+'_0" style="position:absolute;width:'+fanclubfadewidth+'px;height:'+fanclubfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fanclubfadebgcolor+'"></div><div id="'+this.fanclubcanvasbase+'_1" style="position:absolute;width:'+fanclubfadewidth+'px;height:'+fanclubfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fanclubfadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.fanclubslideshowid+'" src="'+this.fanclubpostimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.fanclubcurimageindex++
setInterval("fanclubfadearray["+this.fanclubslideshowid+"].rotateimage()", this.fanclubdelay)
}
}

function fanclubfadepic(obj){
if (obj.fanclubdegree<100){
obj.fanclubdegree+=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.fanclubdegree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.fanclubdegree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.fanclubdegree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.fanclubdegree/100
}
else{
clearInterval(fanclubfadeclear[obj.fanclubslideshowid])
obj.nextcanvas=(obj.fanclubcurcanvas==obj.fanclubcanvasbase+"_0")? obj.fanclubcanvasbase+"_0" : obj.fanclubcanvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.fanclubnextimageindex)
obj.fanclubnextimageindex=(obj.fanclubnextimageindex<obj.fanclubpostimages.length-1)? obj.fanclubnextimageindex+1 : 0
setTimeout("fanclubfadearray["+obj.fanclubslideshowid+"].rotateimage()", obj.fanclubdelay)
}
}
 
fanclubfadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.fanclubtheimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.fanclubtheimages[picindex][1]+'" target="'+this.fanclubtheimages[picindex][2]+'">'
slideHTML+='<img src="'+this.fanclubpostimages[picindex].src+'" border="'+this.fanclubimageborder+'px">'
if (this.fanclubtheimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fanclubfadeshow.prototype.rotateimage=function(){
if (this.fanclubpausecheck==1) //if fanclubpause 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.fanclubcurcanvas] : document.getElementById(this.fanclubcurcanvas)
crossobj.style.zIndex++
fanclubfadeclear[this.fanclubslideshowid]=setInterval("fanclubfadepic(fanclubfadearray["+this.fanclubslideshowid+"])",50)
this.fanclubcurcanvas=(this.fanclubcurcanvas==this.fanclubcanvasbase+"_0")? this.fanclubcanvasbase+"_1" : this.fanclubcanvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.fanclubslideshowid]
ns4imgobj.src=this.fanclubpostimages[this.fanclubcurimageindex].src
}
this.fanclubcurimageindex=(this.fanclubcurimageindex<this.fanclubpostimages.length-1)? this.fanclubcurimageindex+1 : 0
}
 
fanclubfadeshow.prototype.resetit=function(){
this.fanclubdegree=10
var crossobj=iebrowser? iebrowser[this.fanclubcurcanvas] : document.getElementById(this.fanclubcurcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.fanclubdegree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.fanclubdegree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.fanclubdegree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.fanclubdegree/100
}
 
 
fanclubfadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.fanclubcurcanvas] : document.getElementById(this.fanclubcurcanvas)
this.populateslide(crossobj, this.fanclubcurimageindex)
if (this.fanclubpausecheck==1){ //IF SLIDESHOW SHOULD fanclubpause ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.fanclubslideshowid] : document.getElementById("master"+this.fanclubslideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
 

