var fadebgcolor="white",fadearray=[],fadeclear=[],dom=document.getElementById,iebrowser=document.all;
function fadeshow(a,b,c,d,e,f,g){this.pausecheck=f;this.mouseovercheck=0;this.delay=e;this.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";typeof g!="undefined"&&a.sort(function(){return 0.5-Math.random()});this.theimages=a;this.imageborder=parseInt(d);this.postimages=[];for(p=0;p<a.length;p++){this.postimages[p]=new Image;this.postimages[p].src=a[p][0]}b+=
this.imageborder*2;c+=this.imageborder*2;iebrowser&&dom||dom?document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+b+"px;height:"+c+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+b+"px;height:"+c+"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:'+b+"px;height:"+
c+"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>'):document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>');if(iebrowser&&dom||dom)this.startit();else{this.curimageindex++;setInterval("fadearray["+this.slideshowid+"].rotateimage()",this.delay)}}
function fadepic(a){if(a.degree<100){a.degree+=10;if(a.tempobj.filters&&a.tempobj.filters[0])if(typeof a.tempobj.filters[0].opacity=="number")a.tempobj.filters[0].opacity=a.degree;else a.tempobj.style.filter="alpha(opacity="+a.degree+")";else if(a.tempobj.style.MozOpacity)a.tempobj.style.MozOpacity=a.degree/101;else if(a.tempobj.style.KhtmlOpacity)a.tempobj.style.KhtmlOpacity=a.degree/100;else if(a.tempobj.style.opacity&&!a.tempobj.filters)a.tempobj.style.opacity=a.degree/101}else{clearInterval(fadeclear[a.slideshowid]);
a.nextcanvas=a.curcanvas==a.canvasbase+"_0"?a.canvasbase+"_0":a.canvasbase+"_1";a.tempobj=iebrowser?iebrowser[a.nextcanvas]:document.getElementById(a.nextcanvas);a.populateslide(a.tempobj,a.nextimageindex);a.nextimageindex=a.nextimageindex<a.postimages.length-1?a.nextimageindex+1:0;setTimeout("fadearray["+a.slideshowid+"].rotateimage()",a.delay)}}
fadeshow.prototype.populateslide=function(a,b){var c="";if(this.theimages[b][1]!="")c='<a href="'+this.theimages[b][1]+'" target="'+this.theimages[b][2]+'">';c+='<img src="'+this.postimages[b].src+'" border="'+this.imageborder+'px">';if(this.theimages[b][1]!="")c+="</a>";a.innerHTML=c};
fadeshow.prototype.rotateimage=function(){if(this.pausecheck==1)var a=this;if(this.mouseovercheck==1)setTimeout(function(){a.rotateimage()},100);else if(iebrowser&&dom||dom){this.resetit();(this.tempobj=iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas)).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 document.images["defaultslide"+
this.slideshowid].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 a=iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas);if(a.filters&&a.filters[0])if(typeof a.filters[0].opacity=="number")a.filters(0).opacity=this.degree;else a.style.filter="alpha(opacity="+this.degree+")";else if(a.style.MozOpacity)a.style.MozOpacity=this.degree/101;else if(a.style.KhtmlOpacity)a.style.KhtmlOpacity=this.degree/100;else if(a.style.opacity&&!a.filters)a.style.opacity=this.degree/101};
fadeshow.prototype.startit=function(){this.populateslide(iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas),this.curimageindex);if(this.pausecheck==1){var a=this,b=iebrowser?iebrowser["master"+this.slideshowid]:document.getElementById("master"+this.slideshowid);b.onmouseover=function(){a.mouseovercheck=1};b.onmouseout=function(){a.mouseovercheck=0}}this.rotateimage()};
