1/*********************************************** 2* Ultimate Fade-In Slideshow (v1.5): ? Dynamic Drive (http://www.dynamicdrive.com) 3* This notice MUST stay intact for legal use 4* Visit http://www.dynamicdrive.com/ for this script and 100s more. 5***********************************************/ 6 7/* 8var fadeimages=new Array() 9//SET IMAGE PATHS. Extend or contract array as needed 10//fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax 11//fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax 12//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax*/ 13 14var fadeimages2=new Array() 15/* 16//2nd array set example. Remove or add more sets as needed. 17//SET IMAGE PATHS. Extend or contract array as needed 18//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax 19//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax 20//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax*/ 21 22var fadebgcolor="white" 23 24 25 26var fadearray=new Array() /*array to cache fadeshow instances*/ 27var fadeclear=new Array() /*array to cache corresponding clearinterval pointers*/ 28 29var dom=(document.getElementById) /*modern dom browsers*/ 30var iebrowser=document.all 31 32function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder, contentBox){ 33this.pausecheck=pause 34this.mouseovercheck=0 35this.delay=delay 36this.degree=10 /*initial opacity degree (10%)*/ 37this.curimageindex=0 38this.nextimageindex=1 39fadearray[fadearray.length]=this 40this.slideshowid=fadearray.length-1 41this.canvasbase="canvas"+this.slideshowid 42this.curcanvas=this.canvasbase+"_0" 43/*if (typeof displayorder!="undefined") 44theimages.sort(function() {return 0.5 - Math.random();}) *//*thanks to Mike (aka Mwinter) :)*/ 45this.theimages=theimages 46this.imageborder=parseInt(borderwidth) 47this.postimages=new Array() /*preload images*/ 48for (p=0;p<theimages.length;p++){ 49this.postimages[p]=new Image() 50this.postimages[p].src=theimages[p][0] 51} 52 53var fadewidth=fadewidth+this.imageborder*2 54var fadeheight=fadeheight+this.imageborder*2 55var contentdiv=document.getElementById(contentBox); 56 57if (contentdiv) 58{ 59if (iebrowser&&dom||dom) /*if IE5+ or modern browsers (ie: Firefox)*/ 60contentdiv.innerHTML='<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);-moz-opacity:10;-khtml-opacity:10;opacity:10;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);-moz-opacity:10;opacity:10;background-color:'+fadebgcolor+'"></div></div>'; 61else 62contentdiv.innerHTML='<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>'; 63 64if (iebrowser&&dom||dom) /*if IE5+ or modern browsers such as Firefox*/ 65this.startit() 66else{ 67this.curimageindex++ 68setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay) 69} 70} 71} 72 73function fadepic(obj){ 74if (obj.degree<100){ 75obj.degree+=10 76if (obj.tempobj.filters&&obj.tempobj.filters[0]){ 77if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+ 78obj.tempobj.filters[0].opacity=obj.degree 79else //else if IE5.5- 80obj.tempobj.style.filter="alpha(opacity="+obj.degree+")" 81} 82else if (obj.tempobj.style.MozOpacity) 83obj.tempobj.style.MozOpacity=obj.degree/101 84else if (obj.tempobj.style.KhtmlOpacity) 85obj.tempobj.style.KhtmlOpacity=obj.degree/100 86} 87else{ 88clearInterval(fadeclear[obj.slideshowid]) 89obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1" 90obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas) 91obj.populateslide(obj.tempobj, obj.nextimageindex) 92obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0 93setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay) 94} 95} 96 97fadeshow.prototype.populateslide=function(picobj, picindex){ 98var slideHTML="<div style=\"text-align:center;valign:middle\">" 99if (this.theimages[picindex][1]!="") /*if associated link exists for image*/ 100slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">' 101slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">' 102if (this.theimages[picindex][1]!="") /*if associated link exists for image*/ 103slideHTML+='</a>' 104picobj.innerHTML=slideHTML 105} 106 107 108 109fadeshow.prototype.rotateimage=function(){ 110if (this.pausecheck==1) /*if pause onMouseover enabled, cache object*/ 111var cacheobj=this 112if (this.mouseovercheck==1) 113setTimeout(function(){cacheobj.rotateimage()}, 100) 114else if (iebrowser&&dom||dom){ 115this.resetit() 116var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 117crossobj.style.zIndex++ 118fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50) 119this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0" 120} 121else{ 122var ns4imgobj=document.images['defaultslide'+this.slideshowid] 123ns4imgobj.src=this.postimages[this.curimageindex].src 124} 125this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0 126} 127 128fadeshow.prototype.resetit=function(){ 129this.degree=10 130var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 131if (crossobj.filters&&crossobj.filters[0]){ 132if (typeof crossobj.filters[0].opacity=="number") /*if IE6+*/ 133crossobj.filters(0).opacity=this.degree 134else //else if IE5.5- 135crossobj.style.filter="alpha(opacity="+this.degree+")" 136} 137else if (crossobj.style.MozOpacity) 138crossobj.style.MozOpacity=this.degree/101 139else if (crossobj.style.KhtmlOpacity) 140crossobj.style.KhtmlOpacity=this.degree/100 141} 142 143 144fadeshow.prototype.startit=function(){ 145var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 146this.populateslide(crossobj, this.curimageindex) 147if (this.pausecheck==1){ /*IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER*/ 148var cacheobj=this 149var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid) 150crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1} 151crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0} 152} 153this.rotateimage() 154}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.