1 2/* Text and/or Image Crawler Script ©2009 John Davenport Scheuer 3 as first seen in http://www.dynamicdrive.com/forums/ 4 username: jscheuer1 - This Notice Must Remain for Legal Use 5 */ 6 7///////////////// DO NOT EDIT ///////////////// 8 9function marqueeInit(config){ 10 if(!document.createElement) return; 11 marqueeInit.ar.push(config); 12 marqueeInit.run(config.uniqueid); 13} 14 15(function(){ 16 17 if(!document.createElement) return; 18 19 marqueeInit.ar = []; 20 21 document.write('<style type="text/css">.marquee{white-space:nowrap;overflow:hidden;visibility:hidden;}' + 22 '#marq_kill_marg_bord{border:none!important;margin:0!important;}<\/style>'); 23 var c = 0, tTRE = [new RegExp('^\\s*$'), new RegExp('^\\s*'), new RegExp('\\s*$')], 24 req1 = {'position': 'relative', 'overflow': 'hidden'}, defaultconfig = { 25 style: { //default style object for marquee containers without configured style 26 'margin': '0 auto' 27 }, 28 direction: 'left', 29 inc: 2, //default speed - pixel increment for each iteration of a marquee's movement 30 mouse: 'pause' //default mouseover behavior ('pause' 'cursor driven' or false) 31 }, dash, ie = false, oldie = 0, ie5 = false, iever = 0; 32 33 /*@cc_on @*/ 34 /*@if(@_jscript_version >= 5) 35 ie = true; 36 try{document.documentMode = 2000}catch(e){}; 37 iever = Math.min(document.documentMode, navigator.appVersion.replace(/^.*MSIE (\d+\.\d+).*$/, '$1')); 38 if(iever < 6) 39 oldie = 1; 40 if(iever < 5.5){ 41 Array.prototype.push = function(el){this[this.length] = el;}; 42 ie5 = true; 43 dash = new RegExp('(-(.))'); 44 String.prototype.encamel = function(s, m){ 45 s = this; 46 while((m = s.match(dash))) 47 s = s.replace(m[1], m[2].toUpperCase()); 48 return s; 49 }; 50 } 51 @end @*/ 52 53 if(!ie5){ 54 dash = new RegExp('-(.)', 'g'); 55 function toHump(a, b){return b.toUpperCase();}; 56 String.prototype.encamel = function(){return this.replace(dash, toHump);}; 57 } 58 59 if(ie && iever < 8){ 60 marqueeInit.table = []; 61 window.attachEvent('onload', function(){ 62 marqueeInit.OK = true; 63 for(var i = 0; i < marqueeInit.table.length; ++i) 64 marqueeInit.run(marqueeInit.table[i]); 65 }); 66 } 67 68 function intable(el){ 69 while((el = el.parentNode)) 70 if(el.tagName && el.tagName.toLowerCase() === 'table') 71 return true; 72 return false; 73 }; 74 75 marqueeInit.run = function(id){ 76 if(ie && !marqueeInit.OK && iever < 8 && intable(document.getElementById(id))){ 77 marqueeInit.table.push(id); 78 return; 79 } 80 if(!document.getElementById(id)) 81 setTimeout(function(){marqueeInit.run(id);}, 300); 82 else 83 new Marq(c++, document.getElementById(id)); 84 } 85 86 function trimTags(tag){ 87 var r = [], i = 0, e; 88 while((e = tag.firstChild) && e.nodeType == 3 && tTRE[0].test(e.nodeValue)) 89 tag.removeChild(e); 90 while((e = tag.lastChild) && e.nodeType == 3 && tTRE[0].test(e.nodeValue)) 91 tag.removeChild(e); 92 if((e = tag.firstChild) && e.nodeType == 3) 93 e.nodeValue = e.nodeValue.replace(tTRE[1], ''); 94 if((e = tag.lastChild) && e.nodeType == 3) 95 e.nodeValue = e.nodeValue.replace(tTRE[2], ''); 96 while((e = tag.firstChild)) 97 r[i++] = tag.removeChild(e); 98 return r; 99 } 100 101 function Marq(c, tag){ 102 var p, u, s, a, ims, ic, i, marqContent, cObj = this; 103 this.mq = marqueeInit.ar[c]; 104 for (p in defaultconfig) 105 if((this.mq.hasOwnProperty && !this.mq.hasOwnProperty(p)) || (!this.mq.hasOwnProperty && !this.mq[p])) 106 this.mq[p] = defaultconfig[p]; 107 this.mq.style.width = !this.mq.style.width || isNaN(parseInt(this.mq.style.width))? '100%' : this.mq.style.width; 108 if(!tag.getElementsByTagName('img')[0]) 109 this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? tag.offsetHeight + 3 + 'px' : this.mq.style.height; 110 else 111 this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? 'auto' : this.mq.style.height; 112 u = this.mq.style.width.split(/\d/); 113 this.cw = this.mq.style.width? [parseInt(this.mq.style.width), u[u.length - 1]] : ['a']; 114 marqContent = trimTags(tag); 115 tag.className = tag.id = ''; 116 tag.removeAttribute('class', 0); 117 tag.removeAttribute('id', 0); 118 if(ie) 119 tag.removeAttribute('className', 0); 120 tag.appendChild(tag.cloneNode(false)); 121 tag.className = ['marquee', c].join(''); 122 tag.style.overflow = 'hidden'; 123 this.c = tag.firstChild; 124 this.c.appendChild(this.c.cloneNode(false)); 125 this.c.style.visibility = 'hidden'; 126 a = [[req1, this.c.style], [this.mq.style, this.c.style]]; 127 for (i = a.length - 1; i > -1; --i) 128 for (p in a[i][0]) 129 if((a[i][0].hasOwnProperty && a[i][0].hasOwnProperty(p)) || (!a[i][0].hasOwnProperty)) 130 a[i][1][p.encamel()] = a[i][0][p]; 131 this.m = this.c.firstChild; 132 if(this.mq.mouse == 'pause'){ 133 this.c.onmouseover = function(){cObj.mq.stopped = true;}; 134 this.c.onmouseout = function(){cObj.mq.stopped = false;}; 135 } 136 this.m.style.position = 'absolute'; 137 this.m.style.left = '-10000000px'; 138 this.m.style.whiteSpace = 'nowrap'; 139 if(ie5) this.c.firstChild.appendChild((this.m = document.createElement('nobr'))); 140 if(!this.mq.noAddedSpace) 141 this.m.appendChild(document.createTextNode('\xa0')); 142 for(i = 0; marqContent[i]; ++i) 143 this.m.appendChild(marqContent[i]); 144 if(ie5) this.m = this.c.firstChild; 145 ims = this.m.getElementsByTagName('img'); 146 if(ims.length){ 147 for(ic = 0, i = 0; i < ims.length; ++i){ 148 ims[i].style.display = 'inline'; 149 ims[i].style.verticalAlign = ims[i].style.verticalAlign || 'top'; 150 if(typeof ims[i].complete == 'boolean' && ims[i].complete) 151 ic++; 152 else { 153 ims[i].onload = function(){ 154 if(++ic == ims.length) 155 cObj.setup(); 156 }; 157 } 158 if(ic == ims.length) 159 this.setup(); 160 } 161 } 162 else this.setup() 163 } 164 165 Marq.prototype.setup = function(){ 166 if(this.mq.setup) return; 167 this.mq.setup = this; 168 var s, cObj = this; 169 if(this.c.style.height === 'auto') 170 this.c.style.height = this.m.offsetHeight + 4 + 'px'; 171 this.c.appendChild(this.m.cloneNode(true)); 172 this.m = [this.m, this.m.nextSibling]; 173 if(this.mq.mouse == 'cursor driven'){ 174 this.r = this.mq.neutral || 16; 175 this.sinc = this.mq.inc; 176 this.c.onmousemove = function(e){cObj.mq.stopped = false; cObj.directspeed(e)}; 177 if(this.mq.moveatleast){ 178 this.mq.inc = this.mq.moveatleast; 179 if(this.mq.savedirection){ 180 if(this.mq.savedirection == 'reverse'){ 181 this.c.onmouseout = function(e){
182 if(cObj.contains(e)) return; 183 cObj.mq.inc = cObj.mq.moveatleast; 184 cObj.mq.direction = cObj.mq.direction == 'right'? 'left' : 'right';}; 185 } else { 186 this.mq.savedirection = this.mq.direction; 187 this.c.onmouseout = function(e){ 188 if(cObj.contains(e)) return; 189 cObj.mq.inc = cObj.mq.moveatleast; 190 cObj.mq.direction = cObj.mq.savedirection;}; 191 } 192 } else 193 this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.mq.inc = cObj.mq.moveatleast;}; 194 } 195 else 196 this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.slowdeath();}; 197 } 198 this.w = this.m[0].offsetWidth; 199 this.m[0].style.left = 0; 200 this.c.id = 'marq_kill_marg_bord'; 201 this.m[0].style.top = this.m[1].style.top = Math.floor((this.c.offsetHeight - this.m[0].offsetHeight) / 2 - oldie) + 'px'; 202 this.c.id = ''; 203 this.c.removeAttribute('id', 0); 204 this.m[1].style.left = this.w + 'px'; 205 s = this.mq.moveatleast? Math.max(this.mq.moveatleast, this.sinc) : (this.sinc || this.mq.inc); 206 while(this.c.offsetWidth > this.w - s) 207 this.c.style.width = isNaN(this.cw[0])? this.w - s + 'px' : --this.cw[0] + this.cw[1]; 208 this.c.style.visibility = 'visible'; 209 this.runit(); 210 } 211 212 Marq.prototype.slowdeath = function(){ 213 var cObj = this; 214 if(this.mq.inc){ 215 this.mq.inc -= 1; 216 this.timer = setTimeout(function(){cObj.slowdeath();}, 100); 217 } 218 } 219 220 Marq.prototype.runit = function(){ 221 var cObj = this, d = this.mq.direction == 'right'? 1 : -1; 222 if(this.mq.stopped || this.mq.stopMarquee){ 223 setTimeout(function(){cObj.runit();}, 300); 224 return; 225 } 226 if(this.mq.mouse != 'cursor driven') 227 this.mq.inc = Math.max(1, this.mq.inc); 228 if(d * parseInt(this.m[0].style.left) >= this.w) 229 this.m[0].style.left = parseInt(this.m[1].style.left) - d * this.w + 'px'; 230 if(d * parseInt(this.m[1].style.left) >= this.w) 231 this.m[1].style.left = parseInt(this.m[0].style.left) - d * this.w + 'px'; 232 this.m[0].style.left = parseInt(this.m[0].style.left) + d * this.mq.inc + 'px'; 233 this.m[1].style.left = parseInt(this.m[1].style.left) + d * this.mq.inc + 'px'; 234 setTimeout(function(){cObj.runit();}, 30 + (this.mq.addDelay || 0)); 235 } 236 237 Marq.prototype.directspeed = function(e){ 238 e = e || window.event; 239 if(this.timer) clearTimeout(this.timer); 240 var c = this.c, w = c.offsetWidth, l = c.offsetLeft, mp = (typeof e.pageX == 'number'? 241 e.pageX : e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft) - l, 242 lb = (w - this.r) / 2, rb = (w + this.r) / 2; 243 while((c = c.offsetParent)) mp -= c.offsetLeft; 244 this.mq.direction = mp > rb? 'left' : 'right'; 245 this.mq.inc = Math.round((mp > rb? (mp - rb) : mp < lb? (lb - mp) : 0) / lb * this.sinc); 246 } 247 248 Marq.prototype.contains = function(e){ 249 if(e && e.relatedTarget){var c = e.relatedTarget; if(c == this.c) return true; 250 while ((c = c.parentNode)) if(c == this.c) return true;} 251 return false; 252 } 253 254 function resize(){ 255 for(var s, m, i = 0; i < marqueeInit.ar.length; ++i){ 256 if(marqueeInit.ar[i] && marqueeInit.ar[i].setup){ 257 m = marqueeInit.ar[i].setup; 258 s = m.mq.moveatleast? Math.max(m.mq.moveatleast, m.sinc) : (m.sinc || m.mq.inc); 259 m.c.style.width = m.mq.style.width; 260 m.cw[0] = m.cw.length > 1? parseInt(m.mq.style.width) : 'a'; 261 while(m.c.offsetWidth > m.w - s) 262 m.c.style.width = isNaN(m.cw[0])? m.w - s + 'px' : --m.cw[0] + m.cw[1]; 263 } 264 } 265 } 266 267 if (window.addEventListener) 268 window.addEventListener('resize', resize, false); 269 else if (window.attachEvent) 270 window.attachEvent('onresize', resize); 271 272})();
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.