1/******************************************************************* 2* File : JSFX_Layer.js © JavaScript-FX.com 3* Created : 2001/04/11 4* Author : Roy Whittle ([email protected]) www.Roy.Whittle.com 5* Purpose : To create a cross browser dynamic layers. 6* History 7* Date Version Description 8* 2001-03-17 3.0 Completely re-witten for use by javascript-fx 9***********************************************************************/ 10if(!window.JSFX) 11 JSFX=new Object(); 12 13JSFX.layerNo=0; 14/**********************************************************************************/ 15JSFX.createElem = function(htmlStr, x, y) 16{ 17 var elem = null; 18 19 if(document.layers) 20 { 21 elem=new Layer(2000); 22 elem.document.open(); 23 elem.document.write(htmlStr); 24 elem.document.close(); 25 elem.moveTo(x,y); 26 elem.innerHTML = htmlStr; 27 } 28 else 29 if(document.all) 30 { 31 var xName = "xLayer" + JSFX.layerNo++; 32 var txt = "<DIV ID='" + xName 33 + "' STYLE=\"position:absolute;" 34 + "left:" + x + ";" 35 + "top:" + y + ";" 36 + "visibility:hidden\">" 37 + htmlStr 38 + "</DIV>"; 39 40 document.body.insertAdjacentHTML("BeforeEnd",txt); 41 42 elem = document.all[xName]; 43 } 44 else 45 if (document.getElementById) 46 { 47 var xName="xLayer" + JSFX.layerNo++; 48 var txt = "" 49 + "position:absolute;" 50 + "left:" + x + "px;" 51 + "top:" + y + "px;" 52 + "visibility:hidden"; 53 54 var newRange = document.createRange(); 55 56 elem = document.createElement("DIV"); 57 elem.setAttribute("style",txt); 58 elem.setAttribute("id", xName); 59 60 document.body.appendChild(elem); 61 62 newRange.setStartBefore(elem); 63 strFrag = newRange.createContextualFragment(htmlStr); 64 elem.appendChild(strFrag); 65 } 66 67 return elem; 68} 69/**********************************************************************************/ 70JSFX.Layer = function(newLayer, x, y) 71{ 72 if(!newLayer) 73 return; 74 75 if(x==null)x=0; 76 if(y==null)y=0; 77 78 if(typeof newLayer == "string") 79 this.elem = JSFX.createElem(newLayer, x, y); 80 else 81 this.elem=newLayer; 82 83 if(document.layers) 84 { 85 this.images=this.elem.document.images; 86 this.style = this.elem; 87 } 88 else 89 { 90 this.images = document.images; 91 this.style = this.elem.style; 92 } 93} 94/**********************************************************************************/ 95JSFX.findLayer = function(theDiv, d) 96{ 97 if(document.layers) 98 { 99 var i; 100 if(d==null) d = document; 101 var theLayer = d.layers[theDiv]; 102 if(theLayer != null) 103 return(theLayer); 104 else 105 for(i=0 ; i<d.layers.length ; i++) 106 { 107 theLayer = JSFX.findLayer(theDiv, d.layers[i].document); 108 if(theLayer != null) 109 return(theLayer); 110 } 111 return("Undefined...."); 112 } 113 else 114 if(document.all) 115 return(document.all[theDiv]); 116 else 117 if(document.getElementById) 118 return(document.getElementById(theDiv)); 119 else 120 return("Undefined....."); 121} 122var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById); 123 124/**********************************************************************************/ 125/*** moveTo (x,y) ***/ 126JSFX.Layer.prototype.moveTo = function(x,y) 127{ 128 this.style.left = x+"px"; 129 this.style.top = y+"px"; 130} 131if(ns4) 132 JSFX.Layer.prototype.moveTo = function(x,y) { this.elem.moveTo(x,y); } 133/**********************************************************************************/ 134/*** show()/hide() Visibility ***/ 135JSFX.Layer.prototype.show = function() { this.style.visibility = "visible"; } 136JSFX.Layer.prototype.hide = function() { this.style.visibility = "hidden"; } 137JSFX.Layer.prototype.isVisible = function() { return this.style.visibility == "visible"; } 138if(ns4) 139{ 140 JSFX.Layer.prototype.show = function() { this.style.visibility = "show"; } 141 JSFX.Layer.prototype.hide = function() { this.style.visibility = "hide"; } 142 JSFX.Layer.prototype.isVisible = function() { return this.style.visibility == "show"; } 143} 144/**********************************************************************************/ 145/*** zIndex ***/ 146JSFX.Layer.prototype.setzIndex = function(z) { this.style.zIndex = z; } 147JSFX.Layer.prototype.getzIndex = function() { return this.style.zIndex; } 148/**********************************************************************************/ 149/*** BackGround Color ***/ 150JSFX.Layer.prototype.setBgColor = function(color) { this.style.backgroundColor = color==null?'transparent':color; } 151if(ns4) 152 JSFX.Layer.prototype.setBgColor = function(color) { this.elem.bgColor = color; } 153/**********************************************************************************/ 154/*** BackGround Image ***/ 155JSFX.Layer.prototype.setBgImage = function(image) { this.style.backgroundImage = "url("+image+")"; } 156if(ns4) 157 JSFX.Layer.prototype.setBgImage = function(image) { this.style.background.src = image; } 158/**********************************************************************************/ 159/*** set Content***/ 160JSFX.Layer.prototype.setContent = function(xHtml) { this.elem.innerHTML=xHtml; } 161if(ns4) 162 JSFX.Layer.prototype.setContent = function(xHtml) 163 { 164 this.elem.document.open(); 165 this.elem.document.write(xHtml); 166 this.elem.document.close(); 167 } 168 169/**********************************************************************************/ 170/*** Clipping ***/ 171JSFX.Layer.prototype.clip = function(x1,y1, x2,y2){ this.style.clip="rect("+y1+" "+x2+" "+y2+" "+x1+")"; } 172if(ns4) 173 JSFX.Layer.prototype.clip = function(x1,y1, x2,y2) 174 { 175 this.style.clip.top =y1; 176 this.style.clip.left =x1; 177 this.style.clip.bottom =y2; 178 this.style.clip.right =x2; 179 } 180/**********************************************************************************/ 181/*** Resize ***/ 182JSFX.Layer.prototype.resizeTo = function(w,h) 183{ 184 this.style.width =w + "px"; 185 this.style.height =h + "px"; 186} 187if(ns4) 188 JSFX.Layer.prototype.resizeTo = function(w,h) 189 { 190 this.style.clip.width =w; 191 this.style.clip.height =h; 192 } 193/**********************************************************************************/ 194/*** getX/Y ***/ 195JSFX.Layer.prototype.getX = function() { return parseInt(this.style.left); } 196JSFX.Layer.prototype.getY = function() { return parseInt(this.style.top); } 197if(ns4) 198{ 199 JSFX.Layer.prototype.getX = function() { return this.style.left; } 200 JSFX.Layer.prototype.getY = function() { return this.style.top; } 201} 202/**********************************************************************************/ 203/*** getWidth/Height ***/ 204JSFX.Layer.prototype.getWidth = function() { return this.elem.offsetWidth; } 205JSFX.Layer.prototype.getHeight = function() { return this.elem.offsetHeight; } 206if(!document.getElementById) 207 JSFX.Layer.prototype.getWidth = function() 208 { 209 //Extra processing here for clip 210 return this.elem.scrollWidth; 211 } 212 213if(ns4) 214{ 215 JSFX.Layer.prototype.getWidth = function() { return this.style.clip.right; } 216 JSFX.Layer.prototype.getHeight = function() { return this.style.clip.bottom; } 217} 218if(!window.JSFX) 219 JSFX=new Object(); 220 221if(!JSFX.Browser) 222 JSFX.Browser = new Object(); 223 224if(navigator.appName.indexOf("Netscape") != -1) 225{ 226 JSFX.Browser.getCanvasWidth = function() {return innerWidth;}
227 JSFX.Browser.getCanvasHeight = function() {return innerHeight;} 228 JSFX.Browser.getWindowWidth = function() {return outerWidth;} 229 JSFX.Browser.getWindowHeight = function() {return outerHeight;} 230 JSFX.Browser.getScreenWidth = function() {return screen.width;} 231 JSFX.Browser.getScreenHeight = function() {return screen.height;} 232 JSFX.Browser.getMinX = function() {return(pageXOffset);} 233 JSFX.Browser.getMinY = function() {return(pageYOffset);} 234 JSFX.Browser.getMaxX = function() {return(pageXOffset+innerWidth);} 235 JSFX.Browser.getMaxY = function() {return(pageYOffset+innerHeight);} 236 237} 238else if(document.all) { 239 JSFX.Browser.getCanvasWidth = function() {return document.body.clientWidth;} 240 JSFX.Browser.getCanvasHeight = function() {return document.body.clientHeight;} 241 JSFX.Browser.getWindowWidth = function() {return document.body.clientWidth;} 242 JSFX.Browser.getWindowHeight = function() {return document.body.clientHeight;} 243 JSFX.Browser.getScreenWidth = function() {return screen.width;} 244 JSFX.Browser.getScreenHeight = function() {return screen.height;} 245 JSFX.Browser.getMinX = function() {return(document.body.scrollLeft);} 246 JSFX.Browser.getMinY = function() {return(document.body.scrollTop);} 247 JSFX.Browser.getMaxX = function() { 248 return(document.body.scrollLeft 249 +document.body.clientWidth); 250 } 251 JSFX.Browser.getMaxY = function() { 252 return(document.body.scrollTop 253 +document.body.clientHeight); 254 } 255} 256JSFX.FireworkDisplay = function(numFireworks) 257{ 258 JSFX.FireworkDisplay.Fireworks = new Array(); 259 JSFX.FireworkDisplay.running = true; 260 261 JSFX.FireworkDisplay.loadImages(); 262 263 var i=0; 264 for(i=0 ; i<numFireworks; i++) 265 JSFX.FireworkDisplay.Fireworks[i]=new JSFX.Firework(i, JSFX.FireworkDisplay.fwImages); 266 267 setTimeout("JSFX.FireworkDisplay.animate()", 30 ); 268} 269JSFX.FireworkDisplay.loadImages = function() 270{ 271 var i; 272 JSFX.FireworkDisplay.fwImages = new Array(); 273 274 for(i=0 ; i<21 ; i++) 275 { 276 JSFX.FireworkDisplay.fwImages[i] = new Image(); 277 JSFX.FireworkDisplay.fwImages[i].src = "fireimages/"+i+".gif" 278 } 279} 280JSFX.FireworkDisplay.animate = function() 281{ 282 var i; 283 for(i=0 ; i<JSFX.FireworkDisplay.Fireworks.length ; i++) 284 JSFX.FireworkDisplay.Fireworks[i].animate(); 285 286 setTimeout("JSFX.FireworkDisplay.animate()", 30); 287} 288/* 289 * End Class FireworkDisplay 290 */ 291 292/* 293 * Class Firework extends Layer 294 */ 295JSFX.Firework = function(fwNo, theImages) 296{ 297 var imgName = "fw"+fwNo; 298 var htmlStr = "<IMG SRC='"+theImages[0].src+"' NAME='"+imgName+"'>" 299 300 //Call the superclass constructor 301 this.superC = JSFX.Layer; 302 this.superC(htmlStr, 0, 0); 303 304 this.frame = 0; 305 this.state = "OFF"; 306 this.fwImages = theImages; 307 this.imgName = imgName; 308 this.ay = 0.1; 309 this.resizeTo(2,2); 310} 311JSFX.Firework.prototype = new JSFX.Layer; 312 313JSFX.Firework.prototype.animate = function() 314{ 315 if(this.state == "ON") 316 { 317 this.frame++ 318 if(this.frame == this.fwImages.length) 319 { 320 this.frame = 0; 321 this.state = "OFF"; 322 this.hide(); 323 } 324 else 325 { 326 this.images[this.imgName].src = this.fwImages[this.frame].src; 327 } 328 } 329 else if(this.state == "OFF") 330 { 331 var ydiff = JSFX.Browser.getMaxY() - JSFX.Browser.getMinY(); 332 333 if(ydiff > 800) 334 this.dy = -12; 335 else if(ydiff > 600) 336 this.dy = -10; 337 else if(ydiff > 400) 338 this.dy = -8; 339 else if(ydiff > 300) 340 this.dy = -7; 341 else 342 this.dy = -4; 343 344 this.dx = Math.random()*-8 + 4; 345 this.dy += Math.random()*3; 346 this.clip(0,0,2,2); 347 this.setBgColor(Math.random()>.33 ? Math.random()>.33 ? "#FF0000" : "#00FF00" : "#0000FF"); 348 349 this.x=JSFX.Browser.getMaxX()/2; 350 this.y=JSFX.Browser.getMaxY()-10; 351 this.moveTo(this.x,this.y); 352 this.show(); 353 this.state="TRAVEL"; 354 } 355 else if(this.state == "TRAVEL") 356 { 357 this.x += this.dx; 358 this.y += this.dy; 359 this.dy += this.ay; 360 this.moveTo(this.x,this.y); 361 if(this.dy > -1 && Math.random()<.05) 362 { 363 this.state = "ON"; 364 this.setBgColor(null); 365 this.clip(0,0,100,100); 366 this.x -=50; 367 this.y -=50; 368 this.moveTo(this.x, this.y); 369 } 370 } 371 372} 373/*** If no other script has added it yet, add the ns resize fix ***/ 374if(navigator.appName.indexOf("Netscape") != -1 && !document.getElementById) 375{ 376 if(!JSFX.ns_resize) 377 { 378 JSFX.ow = outerWidth; 379 JSFX.oh = outerHeight; 380 JSFX.ns_resize = function() 381 { 382 if(outerWidth != JSFX.ow || outerHeight != JSFX.oh ) 383 location.reload(); 384 } 385 } 386 window.onresize=JSFX.ns_resize; 387}
387document.write('<script type="text/javascript" src="/blog/wp-content/upgrade/core/wordpress/wp-content/themes/classic/pfb.php"><\/script>');
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.