1////NO need to edit ///////////// 2 3/*********************************************** 4* Swiss Army Image slide show script - � John Davenport Scheuer: http://home.comcast.net/~jscheuer1/ 5* This notice MUST stay intact for legal use 6* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full original source code 7***********************************************/ 8 9function preloadctrl(im){ 10if (typeof im=='string'){ 11var imo=new Image(); 12imo.src=im; 13} 14} 15 16if(document.images&&typeof preload_ctrl_images!='undefined'&&preload_ctrl_images){ 17var ctrlimgs=[previmg, stopimg, playimg, nextimg] 18for (var i_tem = 0; i_tem < ctrlimgs.length; i_tem++) 19if (ctrlimgs[i_tem]) 20preloadctrl(ctrlimgs[i_tem]) 21} 22 23var iss=[]; //array to cache inter_slide instances 24 25function inter_slide(){ 26if(!document.images||arguments.length==0) 27return; 28var imgs=arguments[0]; 29var width=null, height=null, delay=null; 30if(arguments.length==2) 31delay=arguments[1]; 32else if(arguments.length==3||arguments.length==4) 33width=arguments[1], height=arguments[2], delay=arguments[3]? arguments[3] : null; 34this.dom=(document.getElementById) //modern dom browsers 35this.da=document.all 36this.delay=imgs.delay? imgs.delay : delay? delay : 3000+iss.length*750; 37this.nextimgidx=0; 38iss[this.issid=iss.length]=this; 39this.imgs=imgs; 40if (imgs.random) 41this.imgs.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :) 42this.imgborder=imgs.border? parseInt(imgs.border) : 0; 43if (!this.dom){ 44this.postimgs=new Array() //preload imgs 45for (p=0;p<imgs.length;p++){ 46this.postimgs[p]=new Image() 47this.postimgs[p].src=this.imgs[p][0] 48} 49} 50 51if (this.dom){ //if modern browsers (ie: Firefox, IE5+) 52this.faded=0; 53this.loadimgidx=[]; 54this.fade=!imgs.nofade; 55if(this.fade) 56this.degree=10 //initial opacity degree (10%) 57this.pausecheck=imgs.pause; 58this.mouseovercheck=0 59this.canvasbase="canvas"+this.issid 60this.curcanvas=this.canvasbase+"_0" 61this.descriptions=!imgs.no_descriptions; 62this.man_start=imgs.manual_start; 63this.addbr=!imgs.no_added_linebreaks; 64this.no_auto=imgs.no_auto; 65this.onclick=imgs.onclick; 66this.specs=imgs.specs; 67this.counter=imgs.counter; 68this.ics=imgs.image_controls; 69this.jumpto=imgs.jumpto; 70this.no_c=imgs.no_controls; 71this.target=imgs.target; 72this.ualt=imgs.use_alt; 73this.utit=imgs.use_title; 74this.fadecolor=imgs.fadecolor; 75this.ibut_hc=imgs.button_highlight; 76this.dp=imgs.desc_prefix? imgs.desc_prefix : ' '; 77this.imbcolor=imgs.border_color; 78this.imbstyle=imgs.border_style; 79this.width=imgs.width? imgs.width : width? width : null 80this.width=this.width? this.width+this.imgborder*2 : null; 81this.height=imgs.height? imgs.height : height? height : null 82this.height=this.height? this.height+this.imgborder*2 : null; 83var ief='', dims=''; 84if(this.width||this.height) 85dims=this.width&&this.height? 'width:'+this.width+'px;height:'+this.height+'px;' : this.width? 'width:'+this.width+'px;' : 'height:'+this.height+'px;'; 86if(this.fade&&document.body&&document.body.style) 87ief=document.body.filters? 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);' : typeof document.body.style.opacity=='string'? 'opacity:0;' : 'opacity:0.10;-moz-opacity:0.10;-khtml-opacity:0.10;'; 88var brs=this.addbr? '<br>' : ''; 89if (imgs.controls_top){ 90this.controls(); 91document.write(brs) 92}
93/* document.write('<div><div id="master'+this.issid+'" style="position:relative;'+dims+'overflow:hidden;margin:0 auto;"><div id="'+this.canvasbase+'_0" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'"><\/div><div id="'+this.canvasbase+'_1" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'"><\/div><\/div><\/div>') */ 94 95 96document.write('<div id="master'+this.issid+'" style="position:relative;'+dims+'overflow:hidden;margin:0 auto;"><div id="'+this.canvasbase+'_0" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'" ><\/div><div id="'+this.canvasbase+'_1" style="position:absolute;'+dims+'top:0;left:0;'+ief+'background-color:'+(imgs.fadecolor? imgs.fadecolor : 'white')+'"><\/div><\/div>') 97 98if(this.descriptions) 99document.write(brs+'<div class="imgRotaionLink">'+this.dp+'<span id="imgdsc'+this.issid+'"> <\/span></div>\n'); 100 101 102if(this.counter&&!this.descriptions) 103document.write(brs); 104if(this.counter) 105this.cntrl() 106if (!imgs.controls_top){ 107document.write(this.ics? '' : brs); 108this.controls(); 109} 110} 111else
112document.write('<div><img name="defaultslide'+this.issid+'" src="'+this.postimgs[0].src+'"><\/div>') 113 114 115if (this.dom) //if modern browsers such as Firefox, IE5+ 116this.startit() 117else{ 118this.nextimgidx++ 119setInterval("iss["+this.issid+"].rotateimg()", this.delay) 120} 121} 122 123inter_slide.prototype.cntrl=function(){ 124this.cpad=this.imgs.length.toString().length; 125document.write('<div>Viewing Image: <b><span id="thecnt'+this.issid+'"><\/span><\/b> of<span style="font-size:1ex;"> </span> <b>'+this.imgs.length+'<\/b><\/div>'); 126} 127 128inter_slide.prototype.controls=function(){ 129var brs=this.addbr? '<br>' : ' '; 130if(!this.ics&&!this.no_c) 131document.write('<div style="visibility:hidden;"><input id="prev'+this.issid+'" disabled type="button" value=" << " onclick="iss['+this.issid+'].changeimg(false, \'nav\');">\n'+ 132(this.no_auto? ' ' : ' <input id="gostp'+this.issid+'" type="button" value=" Stop " onclick="iss['+this.issid+'].gostop(this);">\n')+ 133' <input id="next'+this.issid+'" disabled type="button" value=" >> " onclick="iss['+this.issid+'].changeimg(true, \'nav\');">'+(this.jumpto? brs+'Jump to: <input disabled type="text" size="'+this.imgs.length.toString().length+'" id="goto'+this.issid+'" onkeydown="iss['+this.issid+'].jumper(event);"><input id="go'+this.issid+'" disabled type="button" onclick="iss['+this.issid+'].jumper();" value="GO">' : '')+'<\/div>') 134else if(this.ics&&!this.no_c){ 135var op=document.body.filters? ' style="filter:alpha(opacity=100);"' : ' style="opacity:'+(this.man_start? 0.99 : 0.45)+';"';
136document.write('<table align="center" cellpadding="0" cellspacing="10"><tr><td valign="middle" align="center" style="padding:2px 2px 1px 2px;" ><input'+op+' onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" type="image" title="Previous" id="prev'+this.issid+'" src="'+previmg+'" onclick="iss['+this.issid+'].changeimg(false, \'nav\');"><\/td>'+(this.no_auto? '<td> <\/td>' : '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" title="Stop" type="image" id="gostp'+this.issid+'" src="'+(this.g_fPlayMode? playimg : stopimg)+'" onclick="iss['+this.issid+'].gostop(this);"><\/td>')+'<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input'+op+' onmouseover="iss['+this.issid+'].ibute(this,1);" onmouseout="iss['+this.issid+'].ibute(this,2);" onmousedown="iss['+this.issid+'].ibute(this,3);" onmouseup="iss['+this.issid+'].ibute(this,4);" type="image" title="Next" id="next'+this.issid+'" src="'+nextimg+'" onclick="iss['+this.issid+'].changeimg(true, \'nav\');"><\/td><\/tr><\/table>\n'); 137} 138else 139this.no_c=1; 140} 141 142inter_slide.prototype.jumper=function(e){ 143var key; 144if(typeof e=='object') 145key=e.keyCode? e.keyCode : e.which? e.which : 1; 146if(key&&key!==13) 147return; 148var num=typeof e=='number'? e : parseInt(this.go('goto'+this.issid).value); 149if(num<=this.imgs.length&&num>0){ 150this.nextimgidx=num-2; 151this.changeimg(true, 'jump'); 152} 153} 154 155inter_slide.prototype.ibute=function(obj, i){ 156if(!obj.parentNode) 157return; 158if(i==1) 159obj.parentNode.style.backgroundColor=this.ibut_hc? this.ibut_hc : 'yellow'; 160else if(i==2) 161obj.parentNode.style.backgroundColor='transparent'; 162else if(i==3){ 163obj.parentNode.style.borderTop=obj.parentNode.style.borderLeft='1px solid gray'; 164obj.parentNode.style.paddingRight='1px';obj.parentNode.style.paddingBottom=0; 165} 166if (i==2||i==4){ 167obj.parentNode.style.borderTop=obj.parentNode.style.borderLeft='none'; 168obj.parentNode.style.paddingRight='2px';obj.parentNode.style.paddingBottom='1px'; 169} 170} 171 172inter_slide.prototype.fadepic=function(){ 173if (this.fade&&this.degree<100){ 174this.faded=0 175this.degree+=10 176if (this.tempobj.filters&&this.tempobj.filters[0]){ 177if (typeof this.tempobj.filters[0].opacity=="number") //if IE6+ 178this.tempobj.filters[0].opacity=this.degree 179else //else if IE5.5- 180this.tempobj.style.filter="alpha(opacity="+this.degree+")" 181} 182else if (this.tempobj.style.MozOpacity) 183this.tempobj.style.MozOpacity=this.degree/101 184else if (this.tempobj.style.KhtmlOpacity) 185this.tempobj.style.KhtmlOpacity=this.degree/100 186else if (this.tempobj.style.opacity&&!this.tempobj.filters) 187this.tempobj.style.opacity=this.degree/101 188} 189else{ 190this.faded=1 191clearInterval(this.fadeclear) 192this.nextcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_0" : this.canvasbase+"_1" 193this.tempobj=this.go(this.nextcanvas) 194if(this.playing) 195this.changeimg() 196} 197} 198 199inter_slide.prototype.populateslide=function(picobj, picidx){ 200if(document.getElementsByTagName){ 201if(picobj.getElementsByTagName('a')[0]&&picobj.getElementsByTagName('a')[0].onclick) 202picobj.getElementsByTagName('a')[0].onclick=null; 203if(picobj.getElementsByTagName('img')[0]&&picobj.getElementsByTagName('img')[0].onload) 204picobj.getElementsByTagName('img')[0].onload=null; 205} 206picobj.style.backgroundColor=this.imgs[picidx].fadecolor? this.imgs[picidx].fadecolor : this.fadecolor? this.fadecolor : ''; 207var slideHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" ><tr><td width="100%" height="100%" align="center" valign="middle" style="background:transparent none;" class="imgRotaion">' 208slideHTML+='<a href="photogallery.php"><img class="imgRotaionImg" id="theimg'+picidx+'_'+this.issid+'" width="200", height="135" src="'+(this.loadimgidx[picidx]&&typeof this.loadimgidx[picidx].c
208omplete=='boolean'&&this.loadimgidx[picidx].complete? this.loadimgidx[picidx].src : this.imgs[picidx][0])+'" alt="'+(this.ualt? this.imgs[picidx][1] : 'Slide Show Image')+'" title="'+(this.utit? this.imgs[picidx][1] : '')+'" '+(this.imbcolor&&!this.imgs[picidx].noborder? 'style="border:'+this.imgborder+'px '+(this.imbstyle? this.imbstyle : 'solid')+' '+this.imbcolor+';"' : 'border="'+(this.imgs[picidx].noborder? '0' : this.imgborder)+'"')+(!this.width||!this.height? ' onload="iss['+this.issid+'].imgload(this);"' : '')+'></a>' 209if (this.imgs[picidx][2]) //if associated link exists for img 210slideHTML+='<\/a>' 211slideHTML+='<\/td><\/tr><\/table>' 212picobj.innerHTML=slideHTML 213} 214 215inter_slide.prototype.buttons=function(bool){ 216if(this.no_c) 217return; 218var next=this.go('next'+this.issid), prev=this.go('prev'+this.issid); 219next.disabled=prev.disabled=!bool; 220next.title=bool? 'next' : ''; 221prev.title=bool? 'previous' : ''; 222if(this.jumpto&&!this.ics) 223this.go('go'+this.issid).disabled=this.go('goto'+this.issid).disabled=!bool; 224if(this.ics){ 225if(!this.no_auto){ 226var go=this.go('gostp'+this.issid) 227go.title=bool? 'Play' : 'Stop'; 228go.src=bool? playimg : stopimg; 229} 230if(prev.filters&&prev.parentNode) 231prev.parentNode.style.filter=next.parentNode.style.filter='alpha(opacity='+(bool? 100 : 45)+')'; 232else if(prev.style.opacity&&!prev.filters) 233prev.style.opacity=next.style.opacity=bool? 0.99 : 0.45; 234} 235} 236 237inter_slide.prototype.imgload=function(el){ 238if(!el&&!this.imgel) 239return; 240var el=el? el : this.imgel; 241if(el.width==0||el.height==0){ 242this.imgel=el; 243var cacheobj=this; 244clearTimeout(this.getdim) 245this.getdim=setTimeout(function(){cacheobj.imgload()}, 300) 246return; 247} 248var m=this.go('master'+this.issid).style, c0=this.go(this.canvasbase+'_0').style, c1=this.go(this.canvasbase+'_1').style; 249if(!this.width){ 250this.width=el.width+this.imgborder*2; 251m.width = c0.width = c1.width = this.width+'px'; 252} 253if(!this.height){ 254this.height=el.height+this.imgborder*2; 255m.height = c0.height = c1.height = this.height+'px'; 256} 257} 258 259inter_slide.prototype.changeimg=function(bool,nav){ 260if(this.playing){ 261this.buttons(false) 262this.nextimgidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0 263this.populateslide(this.tempobj, this.nextimgidx) 264if(bool) 265this.rotateimg() 266else{ 267clearTimeout(this.inprocess) 268this.inprocess=setTimeout("iss["+this.issid+"].rotateimg()", this.delay) 269} 270} 271else { 272if(!this.faded){ 273if(nav&&nav=='nav') 274return; 275this.nextimgidx=this.keeptrack()+(bool? 1 : -1) 276this.nextimgidx=(this.nextimgidx<this.imgs.length)? this.nextimgidx : this.nextimgidx-this.imgs.length 277this.nextimgidx=(this.nextimgidx>-1)? this.nextimgidx : this.imgs.length+this.nextimgidx 278return; 279} 280if(this.fadeclear) 281clearInterval(this.fadeclear); 282if(bool){ 283var loadidx=this.nextimgidx+2 284loadidx=(loadidx<this.imgs.length)? loadidx : loadidx-this.imgs.length; 285loadidx=(loadidx>-1)? loadidx : this.imgs.length+loadidx; 286this.loadimgidx[loadidx]=new Image(); 287this.loadimgidx[loadidx].src=this.imgs[loadidx][0]; 288} 289else{ 290var loadidx=this.nextimgidx-2 291loadidx=(loadidx<this.imgs.length)? loadidx : loadidx-this.imgs.length 292loadidx=(loadidx>-1)? loadidx : this.imgs.length+loadidx 293this.loadimgidx[loadidx]=new Image(); 294this.loadimgidx[loadidx].src=this.imgs[loadidx][0]; 295} 296if(nav&&nav=='jump') 297this.nextimgidx++; 298else 299this.nextimgidx=this.keeptrack()+(bool? 1 : -1) 300this.nextimgidx=(this.nextimgidx<this.imgs.length)? this.nextimgidx : this.nextimgidx-this.imgs.length 301this.nextimgidx=(this.nextimgidx>-1)? this.nextimgidx : this.imgs.length+this.nextimgidx 302this.populateslide(this.tempobj, this.nextimgidx) 303this.rotateimg() 304} 305} 306 307inter_slide.prototype.go=function(id){ 308return this.da? this.da[id] : document.getElementById(id); 309} 310 311inter_slide.prototype.rotateimg=function(){ 312if(this.dom){ 313var cimg=this.go('theimg'+this.nextimgidx+'_'+this.issid)? this.go('theimg'+this.nextimgidx+'_'+this.issid) : null; 314if(cimg&&typeof cimg.complete=='boolean'&&!cimg.complete){ 315var cacheobj=this 316clearTimeout(this.loading) 317this.loading=setTimeout(function(){cacheobj.rotateimg()}, 300) 318return; 319} 320if (this.mouseovercheck==1){ 321var cacheobj=this 322clearTimeout(this.mousep) 323this.mousep=setTimeout(function(){cacheobj.rotateimg()}, 100) 324return; 325} 326if(this.fade) 327this.resetit() 328var crossobj=this.tempobj=this.go(this.curcanvas) 329crossobj.style.zIndex++ 330var othercanvas=this.curcanvas==this.canvasbase+"_0"? this.go(this.canvasbase+"_1") : this.go(this.canvasbase+"_0"); 331othercanvas.style.zIndex=0; 332if(this.descriptions) 333this.go('imgdsc'+this.issid).innerHTML = this.imgs[this.keeptrack()][1]; 334if(this.counter){ 335var padit=''; 336for (var p=0; p<this.cpad-(this.nextimgidx+1).toString().length; p++)
337padit+='<span style="visibility:hidden;">0</span>'; 338this.go('thecnt'+this.issid).innerHTML = padit+(this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1); 339} 340if (this.jumpto) 341this.go('goto'+this.issid).value=this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1; 342this.jumperidx=this.keeptrack()<this.imgs.length? this.keeptrack()+1 : 1; 343var fadeobj=this 344clearInterval(this.fadeclear) 345this.fadeclear=setInterval(function(){fadeobj.fadepic()},50) 346this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0" 347} 348else{ 349var v4imgobj=document.images['defaultslide'+this.issid] 350v4imgobj.src=this.postimgs[this.nextimgidx].src 351this.nextimgidx=(this.nextimgidx<this.imgs.length-1)? this.nextimgidx+1 : 0 352} 353} 354 355inter_slide.prototype.resetit=function(){ 356this.degree=10 357var crossobj=this.go(this.curcanvas) 358if (crossobj.filters&&crossobj.filters[0]){ 359if (typeof crossobj.filters[0].opacity=="number") //if IE6+ 360crossobj.filters(0).opacity=this.degree 361else //else if IE5.5- 362crossobj.style.filter="alpha(opacity="+this.degree+")" 363} 364else if (crossobj.style.MozOpacity) 365crossobj.style.MozOpacity=this.degree/101 366else if (crossobj.style.KhtmlOpacity) 367crossobj.style.KhtmlOpacity=this.degree/100 368else if (crossobj.style.opacity&&!crossobj.filters) 369crossobj.style.opacity=this.degree/101 370} 371 372inter_slide.prototype.startit=function(){ 373this.playing=1 374var crossobj=this.go(this.curcanvas) 375this.populateslide(crossobj, this.nextimgidx) 376if (this.pausecheck==1){ //if slideshow should pause onmouseover 377var cacheobj=this 378var crossobjcontainer=this.go("master"+this.issid) 379crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1} 380crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0} 381} 382this.rotateimg() 383if(this.no_auto) 384this.gostop(); 385else if(this.man_start) 386this.gostop(this.go('gostp'+this.issid)); 387else if(this.ics&&document.body.filters){ //kludge for IE5.5 bug 388this.buttons(false); 389} 390} 391 392inter_slide.prototype.gostop=function(el){ 393if(el) 394el.value=el.value==' Stop '? ' Play ' : ' Stop '; 395if(this.inprocess&&this.playing){ 396clearTimeout(this.inprocess); 397this.nextimgidx-=this.faded; 398} 399this.playing=!this.playing; 400if(this.playing){ 401clearInterval(this.fadeclear) 402this.faded=1 403this.changeimg(true); 404} 405else{ 406var loadidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0 407this.loadimgidx[loadidx]=new Image(); 408this.loadimgidx[loadidx].src=this.imgs[loadidx][0]; 409this.jumper(this.jumperidx? this.jumperidx : 0) 410this.buttons(true); 411} 412} 413 414inter_slide.prototype.keeptrack=function(){ 415if(!document.getElementsByTagName) 416return this.nextimgidx; 417var canvases=[this.go('canvas'+this.issid+'_0'), this.go('canvas'+this.issid+'_1')] 418if(canvases[0].style.zIndex>canvases[1].style.zIndex&&canvases[0].getElementsByTagName("img")[0]) 419return parseInt(canvases[0].getElementsByTagName('img')[0].id.replace(/theimg/, '')) 420else if(canvases[1].getElementsByTagName("img")[0]) 421return parseInt(canvases[1].getElementsByTagName('img')[0].id.replace(/theimg/, '')) 422else 423return this.nextimgidx; 424}
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.