/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © 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.
***********************************************/
var delay = 5;
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed  //
fadeimages[0]=["images-slideshow/00.jpg", "http://flickr.com/photos/mamchenkov/113081739/", "_new"]
fadeimages[1]=["images-slideshow/01.jpg", "http://flickr.com/photos/greenacre8/210979772/", "_new"]
fadeimages[2]=["images-slideshow/02.jpg", "http://flickr.com/photos/62337512@N00/1195596373/", "_new"]
fadeimages[3]=["images-slideshow/03.jpg", "http://flickr.com/photos/mamchenkov/113089188/", "_new"]
fadeimages[4]=["images-slideshow/04.jpg", "http://flickr.com/photos/mamchenkov/113082136/in/set-72057594083044297/", "_new"]
fadeimages[5]=["images-slideshow/05.jpg", "http://flickr.com/photos/garyt70/1770321463/", "_new"]
fadeimages[6]=["images-slideshow/06.jpg", "http://flickr.com/photos/mamchenkov/113052601/", "_new"]
fadeimages[7]=["images-slideshow/07.jpg", "http://flickr.com/photos/mamchenkov/113052914/", "_new"]
fadeimages[8]=["images-slideshow/08.jpg", "http://flickr.com/photos/mamchenkov/113053502/", "_new"]
fadeimages[9]=["images-slideshow/09.jpg", "http://www.flickr.com/photos/sonofgroucho/2737128677/in/set-72157606414610393/", "_new"]
fadeimages[10]=["images-slideshow/10.jpg", "http://flickr.com/photos/58789412@N00/504707277/", "_new"]
fadeimages[11]=["images-slideshow/11.jpg", "http://flickr.com/photos/mamchenkov/113063295/", "_new"]
fadeimages[12]=["images-slideshow/12.jpg", "http://www.flickr.com/photos/10135007@N08/2361556577/", "_new"]
fadeimages[13]=["images-slideshow/13.jpg", "http://flickr.com/photos/lady_don/3200163753/", "_new"]
fadeimages[14]=["images-slideshow/14.jpg", "http://flickr.com/photos/mamchenkov/113062335/", "_new"]
fadeimages[15]=["images-slideshow/15.jpg", "http://flickr.com/photos/r_hudsonphotographicimages/2849418088/", "_new"]
fadeimages[16]=["images-slideshow/16.jpg", "http://flickr.com/photos/mamchenkov/113062973/", "_new"]
fadeimages[17]=["images-slideshow/17.jpg", "http://flickr.com/photos/mamchenkov/113063208/", "_new"]
fadeimages[18]=["images-slideshow/18.jpg", "http://www.flickr.com/photos/tenerife/229970999/", "_new"]
fadeimages[19]=["images-slideshow/19.jpg", "http://www.flickr.com/photos/58789412@N00/402106277/in/set-72157594546730882/", "_new"]
fadeimages[20]=["images-slideshow/20.jpg", "http://www.flickr.com/photos/elroy/79151509/", "_new"]
fadeimages[21]=["images-slideshow/21.jpg", "http://www.flickr.com/photos/robs-pics/176225656/", "_new"]
fadeimages[22]=["images-slideshow/22.jpg", "http://www.flickr.com/photos/58789412@N00/402098030/in/set-72157594546730882/", "_new"]
fadeimages[23]=["images-slideshow/23.jpg", "http://www.flickr.com/photos/sican/2408412697/in/set-72157604505106436/", "_new"]
fadeimages[24]=["images-slideshow/24.jpg", "http://www.flickr.com/photos/philphotography/2062153464/", "_new"]
fadeimages[25]=["images-slideshow/25.jpg", "http://www.flickr.com/photos/sonofgroucho/2767239611/in/set-72157606414610393/", "_new"]
fadeimages[26]=["images-slideshow/26.jpg", "http://www.flickr.com/photos/67608533@N00/614532720/", "_new"]
fadeimages[27]=["images-slideshow/27.jpg", "http://www.flickr.com/photos/58789412@N00/402106508/", "_new"]
fadeimages[28]=["images-slideshow/28.jpg", "http://www.flickr.com/photos/sonofgroucho/2730392517/in/set-72157606414610393/", "_new"]
fadeimages[29]=["images-slideshow/29.jpg", "http://www.flickr.com/photos/babywalrus/510933268/", "_new"]
fadeimages[30]=["images-slideshow/30.jpg", "http://www.flickr.com/photos/banyan_tree/3068281777/in/set-72157602984165228/", "_new"]
fadeimages[31]=["images-slideshow/31.jpg", "http://www.flickr.com/photos/adamraoof/468639788/in/set-72157600109776474/", "_new"]
fadeimages[32]=["images-slideshow/32.jpg", "http://www.flickr.com/photos/iswc/1478274835/", "_new"]
fadeimages[33]=["images-slideshow/33.jpg", "http://www.flickr.com/photos/22630439@N04/2178619105/", "_new"]
fadeimages[34]=["images-slideshow/34.jpg", "http://www.flickr.com/photos/valentinap/1182703417/in/set-72157601578001641/", "_new"]
fadeimages[35]=["images-slideshow/35.jpg", "http://www.flickr.com/photos/valentinap/1183495076/", "_new"]
fadeimages[36]=["images-slideshow/36.jpg", "http://www.flickr.com/photos/mamchenkov/113063235/", "_new"]
fadeimages[37]=["images-slideshow/37.jpg", "http://www.flickr.com/photos/mamchenkov/113062203/", "_new"]
fadeimages[38]=["images-slideshow/38.jpg", "http://www.flickr.com/photos/mamchenkov/113081184/", "_new"]
fadeimages[39]=["images-slideshow/39.jpg", "http://www.flickr.com/photos/mamchenkov/113077391/", "_new"]
fadeimages[40]=["images-slideshow/40.jpg", "http://www.flickr.com/photos/mamchenkov/113066620/", "_new"]
fadeimages[41]=["images-slideshow/41.jpg", "http://www.flickr.com/photos/mamchenkov/113067506/", "_new"]
fadeimages[42]=["images-slideshow/42.jpg", "http://www.flickr.com/photos/mamchenkov/113066828/", "_new"]
fadeimages[43]=["images-slideshow/43.jpg", "http://www.flickr.com/photos/mamchenkov/228815978/", "_new"]
fadeimages[44]=["images-slideshow/44.jpg", "http://www.flickr.com/photos/67608533@N00/613475351/in/set-72157600847965334/", "_new"]
fadeimages[45]=["images-slideshow/45.jpg", "http://www.flickr.com/photos/sonofgroucho/2709003611/", "_new"]
fadeimages[46]=["images-slideshow/46.jpg", "http://www.flickr.com/photos/sonofgroucho/2732678799/in/set-72157606414610393/", "_new"]
fadeimages[47]=["images-slideshow/47.jpg", "http://www.flickr.com/photos/sonofgroucho/2754521964/in/set-72157606414610393/"]
fadeimages[48]=["images-slideshow/48.jpg", "http://www.flickr.com/photos/valentinap/1183473306/", "_new"]
fadeimages[49]=["images-slideshow/49.jpg", "http://www.flickr.com/photos/aiace/2119158070/", "_new"]
fadeimages[50]=["images-slideshow/50.jpg", "http://www.flickr.com/photos/mamchenkov/134583510/", "_new"]
fadeimages[51]=["images-slideshow/51.jpg", "http://www.flickr.com/photos/mamchenkov/134898933/", "_new"]
fadeimages[52]=["images-slideshow/52.jpg", "http://www.flickr.com/photos/sican/2408413393/", "_new"]
fadeimages[53]=["images-slideshow/53.jpg", "http://www.flickr.com/photos/mamchenkov/134666995/", "_new"]
fadeimages[54]=["images-slideshow/54.jpg", "http://www.flickr.com/photos/mamchenkov/2977320977/in/set-72157608416076399/", "_new"]
fadeimages[55]=["images-slideshow/55.jpg", "http://www.flickr.com/photos/-babo/1849438492/", "_new"]
fadeimages[56]=["images-slideshow/56.jpg", "http://www.flickr.com/photos/58789412@N00/398069830/in/set-72157594546730882/", "_new"]

var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=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.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause 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.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}