// CREDITS: // Image Scroller 2.03 with double-fade effect // By Peter Gehrig // Copyright (c) 2003 Peter Gehrig. All rights reserved. // Permission given to use the script provided that this notice remains as is. // Additional scripts can be found at http://www.24fun.com // info@24fun.com // 9/6/2002 // IMPORTANT: // If you add this script to a script-library or script-archive // you have to add a highly visible link to // http://www.24fun.com on the webpage // where this script will be featured // URLs of slides var slideurl=new Array("http://www.bendidatravel.com/images/front/Blue Mosque 440.JPG") // comments displayed below the slides var slidecomment=new Array("") // links for each slide var slidelink=new Array("#") // targets of the links. Allowed values: "_parent", "_top", "_blank", "_self" var slidetarget=new Array("_parent") // the width of the slideshow (pixels) var scrollerwidth=120 // the height of the slideshow (pixels) var scrollerheight=333 // width of the transparent zones (pixels) var translayerszone=6 // font-attributes for the comments var slidefont="Arial" var slidefontcolor="blue" var slidefontsize="2" // background-color of webpage var pagebgcolor="#FFFAEC" // do not edit below this line var translayerswidth=1 var translayersmax=Math.floor(translayerszone/translayerswidth) var translayersleftpos=0 var translayersopacity=100 var translayersfactor=100/translayersmax var translayerswidthall=translayersmax*translayerswidth var allpicturewidth var distancepictopic=0 var scrollerleft=0 var scrollertop=0 var pause=20 var step=1 var newstep=step var clipleft,clipright,cliptop,clipbottom var i_picture=0 var timer var picturecontent="" var ns4=document.layers?1:0 var ns6=document.getElementById&&!document.all?1:0 var ie=document.all?1:0 var browserinfos=navigator.userAgent var opera=browserinfos.match(/Opera/) var direction = 1 var preloadedimages=new Array() for (i=0;i= scrollerwidth) { if (f && (document.all.picturediv.style.posLeft > scrollerleft)) { clipleft+=step*direction direction = direction*(-1) } document.all.picturediv.style.posLeft -= step*direction clipright+=step*direction if (clipright>scrollerwidth) { clipleft+=step*direction } document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout("scrollpicture()",pause) } else { direction = direction*(-1) f= true clipright+=step*direction clipleft+=step*direction document.all.picturediv.style.posLeft -= step*direction document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout("scrollpicture()",pause) } } if (ns6) { if (parseInt(document.getElementById('picturediv').style.left) + allpicturewidth >= scrollerwidth) { if (f && (parseInt(document.getElementById('picturediv').style.left) > scrollerleft)) { clipleft+=step*direction direction = direction*(-1) } document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step*direction clipright+=step*direction if (clipright>scrollerwidth) { clipleft+=step*direction } document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout("scrollpicture()",pause) } else { direction = direction*(-1) f= true clipright+=step*direction clipleft+=step*direction document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step*direction document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout("scrollpicture()",pause) } } if (ns4) { if (document.roof.document.picturediv.left>=scrollerleft-allpicturewidth) { document.roof.document.picturediv.left-=step document.roof.document.picturediv.clip.right+=step if (document.roof.document.picturediv.clip.right>scrollerwidth) { document.roof.document.picturediv.clip.left+=step } var timer=setTimeout("scrollpicture()",pause) } else { resetposition() } } } function onmsover() { // step=0 } function onmsout() { // step=newstep } function resetposition() { if (ie) { document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth clipleft=0 clipright=0 document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" scrollpicture() } if (ns6) { allpicturewidth=document.getElementById('emptypicturediv').offsetWidth document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth clipleft=0 clipright=0 document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" scrollpicture() } if (ns4) { document.roof.document.picturediv.left=scrollerleft+scrollerwidth document.roof.document.picturediv.clip.left=0 document.roof.document.picturediv.clip.right=0 scrollpicture() } } picturecontent="" picturecontent+="" picturecontent+="" for (i=0;i<=slideurl.length-1;i++) { picturecontent+="" } picturecontent+="" picturecontent+="" for (i=0;i<=slideurl.length-1;i++) { picturecontent+="" } picturecontent+="" picturecontent+="
" picturecontent+="" picturecontent+="" picturecontent+="
" picturecontent+="" picturecontent+=slidecomment[i] picturecontent+="" picturecontent+="
" if (ie || ns6) { document.write('
') document.write('') if (ie && !opera) { for (i=0;i<=translayersmax;i++) { document.write(' ') translayersleftpos+=translayerswidth translayersopacity-=translayersfactor } translayersleftpos=scrollerwidth-translayersleftpos for (ii=0;ii<=translayersmax;ii++) { document.write(' ') translayersleftpos+=translayerswidth translayersopacity+=translayersfactor } } if (ns6 && !opera) { for (i=0;i<=translayersmax-1;i++) { document.write(' ') translayersleftpos+=translayerswidth translayersopacity-=translayersfactor if (translayersopacity<0) {translayersopacity=0.001} } translayersleftpos=scrollerwidth-translayersleftpos translayersopacity=0.001 for (i=0;i<=translayersmax-1;i++) { document.write(' ') translayersleftpos+=translayerswidth translayersopacity+=translayersfactor } } document.write('
') document.write('') window.onload=init } if (ns4) { document.write('') document.write(''+picturecontent+'') document.write('') window.onload=init }