1// ----------------------------------------------------------------------------------- 2// 3// Lightbox v2.03 4// by Lokesh Dhakar - http://www.huddletogether.com 5// 4/9/06 6// 7// For more information on this script, visit: 8// http://huddletogether.com/projects/lightbox2/ 9// 10// Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/ 11// 12// Credit also due to those who have helped, inspired, and made their code available to the public. 13// Including: Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.org), Thomas Fuchs(mir.aculo.us), and others. 14// 15// 16// ----------------------------------------------------------------------------------- 17/* 18 19 Table of Contents 20 ----------------- 21 Configuration 22 Global Variables 23 24 Extending Built-in Objects 25 - Object.extend(Element) 26 - Array.prototype.removeDuplicates() 27 - Array.prototype.empty() 28 29 Lightbox Class Declaration 30 - initialize() 31 - start() 32 - changeImage() 33 - resizeImageContainer() 34 - showImage() 35 - updateDetails() 36 - updateNav() 37 - enableKeyboardNav() 38 - disableKeyboardNav() 39 - keyboardAction() 40 - preloadNeighborImages() 41 - end() 42 43 Miscellaneous Functions 44 - getPageScroll() 45 - getPageSize() 46 - getKey() 47 - listenKey() 48 - showSelectBoxes() 49 - hideSelectBoxes() 50 - showFlash() 51 - hideFlash() 52 - pause() 53 - initLightbox() 54 55 Function Calls 56 - addLoadEvent(initLightbox) 57 58*/ 59// ----------------------------------------------------------------------------------- 60 61// 62// Configuration 63// 64var fileLoadingImage = "page/lightbox/image/loading.gif"; 65var fileBottomNavCloseImage = "page/lightbox/image/closelabel.gif";
66 67var animate = true; // toggles resizing animations 68var resizeSpeed = 7; // controls the speed of the image resizing animations (1=slowest and 10=fastest) 69 70var borderSize = 10; //if you adjust the padding in the CSS, you will need to update this variable 71 72// ----------------------------------------------------------------------------------- 73 74// 75// Global Variables 76// 77var imageArray = new Array; 78var activeImage; 79 80if(animate == true){ 81 overlayDuration = 0.2; // shadow fade in/out duration 82 if(resizeSpeed > 10){ resizeSpeed = 10;} 83 if(resizeSpeed < 1){ resizeSpeed = 1;} 84 resizeDuration = (11 - resizeSpeed) * 0.15; 85} else { 86 overlayDuration = 0; 87 resizeDuration = 0; 88} 89 90// ----------------------------------------------------------------------------------- 91 92// 93// Additional methods for Element added by SU, Couloir 94// - further additions by Lokesh Dhakar (huddletogether.com) 95// 96Object.extend(Element, { 97 getWidth: function(element) { 98 element = $(element); 99 return element.offsetWidth; 100 }, 101 setWidth: function(element,w) { 102 element = $(element); 103 element.style.width = w +"px"; 104 }, 105 setHeight: function(element,h) { 106 element = $(element); 107 element.style.height = h +"px"; 108 }, 109 setTop: function(element,t) { 110 element = $(element); 111 element.style.top = t +"px"; 112 }, 113 setSrc: function(element,src) { 114 element = $(element); 115 element.src = src; 116 }, 117 setHref: function(element,href) { 118 element = $(element); 119 element.href = href; 120 }, 121 setInnerHTML: function(element,content) { 122 element = $(element); 123 element.innerHTML = content; 124 } 125}); 126 127// ----------------------------------------------------------------------------------- 128 129// 130// Extending built-in Array object 131// - array.removeDuplicates() 132// - array.empty() 133// 134Array.prototype.removeDuplicates = function () { 135 for(i = 0; i < this.length; i++){ 136 for(j = this.length-1; j>i; j--){ 137 if(this[i][0] == this[j][0]){ 138 this.splice(j,1); 139 } 140 } 141 } 142} 143 144// ----------------------------------------------------------------------------------- 145 146Array.prototype.empty = function () { 147 for(i = 0; i <= this.length; i++){ 148 this.shift(); 149 } 150} 151 152// ----------------------------------------------------------------------------------- 153 154// 155// Lightbox Class Declaration 156// - initialize() 157// - start() 158// - changeImage() 159// - resizeImageContainer() 160// - showImage() 161// - updateDetails() 162// - updateNav() 163// - enableKeyboardNav() 164// - disableKeyboardNav() 165// - keyboardNavAction() 166// - preloadNeighborImages() 167// - end() 168// 169// Structuring of code inspired by Scott Upton (http://www.uptonic.com/) 170// 171var Lightbox = Class.create(); 172 173Lightbox.prototype = { 174 175 // initialize() 176 // Constructor runs on completion of the DOM loading. Loops through anchor tags looking for 177 // 'lightbox' references and applies onclick events to appropriate links. The 2nd section of 178 // the function inserts html at the bottom of the page which is used to display the shadow 179 // overlay and the image container. 180 // 181 initialize: function() { 182 if (!document.getElementsByTagName){ return; } 183 var anchors = document.getElementsByTagName('a'); 184 var areas = document.getElementsByTagName('area'); 185 186 // loop through all anchor tags 187 for (var i=0; i<anchors.length; i++){ 188 var anchor = anchors[i]; 189 190 var relAttribute = String(anchor.getAttribute('rel')); 191 192 // use the string.match() method to catch 'lightbox' references in the rel attribute 193 if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){ 194 anchor.onclick = function () {myLightbox.start(this); return false;} 195 } 196 } 197 198 // loop through all area tags 199 // todo: combine anchor & area tag loops 200 for (var i=0; i< areas.length; i++){ 201 var area = areas[i]; 202 203 var relAttribute = String(area.getAttribute('rel')); 204 205 // use the string.match() method to catch 'lightbox' references in the rel attribute 206 if (area.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){ 207 area.onclick = function () {myLightbox.start(this); return false;} 208 } 209 } 210 211 // The rest of this code inserts html at the bottom of the page that looks similar to this: 212 // 213 // <div id="overlay"></div> 214 // <div id="lightbox"> 215 // <div id="outerImageContainer"> 216 // <div id="imageContainer"> 217 // <img id="lightboxImage"> 218 // <div style="" id="hoverNav"> 219 // <a href="#" id="prevLink"></a> 220 // <a href="#" id="nextLink"></a> 221 // </div> 222 // <div id="loading"> 223 // <a href="#" id="loadingLink"> 224 // <img src="page/lightbox/image/loading.gif"> 225 // </a> 226 // </div> 227 // </div> 228 // </div> 229 // <div id="imageDataContainer"> 230 // <div id="imageData"> 231 // <div id="imageDetails"> 232 // <span id="caption"></span>
233 // <span id="numberDisplay"></span> 234 // </div> 235 // <div id="bottomNav"> 236 // <a href="#" id="bottomNavClose"> 237 // <img src="page/lightbox/image/close.gif"> 238 // </a> 239 // </div> 240 // </div> 241 // </div> 242 // </div> 243 244 245 var objBody = document.getElementsByTagName("body").item(0); 246 247 var objOverlay = document.createElement("div"); 248 objOverlay.setAttribute('id','overlay'); 249 objOverlay.style.display = 'none'; 250 objOverlay.onclick = function() { myLightbox.end(); } 251 objBody.appendChild(objOverlay); 252 253 var objLightbox = document.createElement("div"); 254 objLightbox.setAttribute('id','lightbox'); 255 objLightbox.style.display = 'none'; 256 objLightbox.onclick = function(e) { // close Lightbox is user clicks shadow overlay 257 if (!e) var e = window.event; 258 var clickObj = Event.element(e).id; 259 if ( clickObj == 'lightbox') { 260 myLightbox.end(); 261 } 262 }; 263 objBody.appendChild(objLightbox); 264 265 var objOuterImageContainer = document.createElement("div"); 266 objOuterImageContainer.setAttribute('id','outerImageContainer'); 267 objLightbox.appendChild(objOuterImageContainer); 268 269 // When Lightbox starts it will resize itself from 250 by 250 to the current image dimension. 270 // If animations are turned off, it will be hidden as to prevent a flicker of a 271 // white 250 by 250 box. 272 if(animate){ 273 Element.setWidth('outerImageContainer', 250); 274 Element.setHeight('outerImageContainer', 250); 275 } else { 276 Element.setWidth('outerImageContainer', 1); 277 Element.setHeight('outerImageContainer', 1); 278 } 279 280 var objImageContainer = document.createElement("div"); 281 objImageContainer.setAttribute('id','imageContainer'); 282 objOuterImageContainer.appendChild(objImageContainer); 283 284 var objLightboxImage = document.createElement("img"); 285 objLightboxImage.setAttribute('id','lightboxImage'); 286 objImageContainer.appendChild(objLightboxImage); 287 288 var objHoverNav = document.createElement("div"); 289 objHoverNav.setAttribute('id','hoverNav'); 290 objImageContainer.appendChild(objHoverNav); 291 292 var objPrevLink = document.createElement("a"); 293 objPrevLink.setAttribute('id','prevLink'); 294 objPrevLink.setAttribute('href','#'); 295 objHoverNav.appendChild(objPrevLink); 296 297 var objNextLink = document.createElement("a"); 298 objNextLink.setAttribute('id','nextLink'); 299 objNextLink.setAttribute('href','#'); 300 objHoverNav.appendChild(objNextLink); 301 302 var objLoading = document.createElement("div"); 303 objLoading.setAttribute('id','loading'); 304 objImageContainer.appendChild(objLoading); 305 306 var objLoadingLink = document.createElement("a"); 307 objLoadingLink.setAttribute('id','loadingLink'); 308 objLoadingLink.setAttribute('href','#'); 309 objLoadingLink.onclick = function() { myLightbox.end(); return false; } 310 objLoading.appendChild(objLoadingLink); 311 312 var objLoadingImage = document.createElement("img"); 313 objLoadingImage.setAttribute('src', fileLoadingImage); 314 objLoadingLink.appendChild(objLoadingImage); 315 316 var objImageDataContainer = document.createElement("div"); 317 objImageDataContainer.setAttribute('id','imageDataContainer'); 318 objImageDataContainer.className = 'clearfix'; 319 objLightbox.appendChild(objImageDataContainer); 320 321 var objImageData = document.createElement("div"); 322 objImageData.setAttribute('id','imageData'); 323 objImageDataContainer.appendChild(objImageData); 324 325 var objImageDetails = document.createElement("div"); 326 objImageDetails.setAttribute('id','imageDetails'); 327 objImageData.appendChild(objImageDetails); 328 329 var objCaption = document.createElement("span"); 330 objCaption.setAttribute('id','caption'); 331 objImageDetails.appendChild(objCaption); 332
333 var objNumberDisplay = document.createElement("span"); 334 objNumberDisplay.setAttribute('id','numberDisplay'); 335 objImageDetails.appendChild(objNumberDisplay); 336 337 var objBottomNav = document.createElement("div"); 338 objBottomNav.setAttribute('id','bottomNav'); 339 objImageData.appendChild(objBottomNav); 340 341 var objBottomNavCloseLink = document.createElement("a"); 342 objBottomNavCloseLink.setAttribute('id','bottomNavClose'); 343 objBottomNavCloseLink.setAttribute('href','#'); 344 objBottomNavCloseLink.onclick = function() { myLightbox.end(); return false; } 345 objBottomNav.appendChild(objBottomNavCloseLink); 346 347 var objBottomNavCloseImage = document.createElement("img"); 348 objBottomNavCloseImage.setAttribute('src', fileBottomNavCloseImage); 349 objBottomNavCloseLink.appendChild(objBottomNavCloseImage); 350 }, 351 352 // 353 // start() 354 // Display overlay and lightbox. If image is part of a set, add siblings to imageArray. 355 // 356 start: function(imageLink) { 357 358 hideSelectBoxes(); 359 hideFlash(); 360 361 // stretch overlay to fill page and fade in 362 var arrayPageSize = getPageSize(); 363 Element.setHeight('overlay', arrayPageSize[1]); 364 365 new Effect.Appear('overlay', { duration: overlayDuration, from: 0.0, to: 0.8 }); 366 367 imageArray = []; 368 imageNum = 0; 369 370 if (!document.getElementsByTagName){ return; } 371 var anchors = document.getElementsByTagName('a'); 372 373 // if image is NOT part of a set.. 374 if((imageLink.getAttribute('rel') == 'lightbox')){ 375 // add single image to imageArray 376 imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title'))); 377 } else { 378 // if image is part of a set.. 379 380 // loop through anchors, find other images in set, and add them to imageArray 381 for (var i=0; i<anchors.length; i++){ 382 var anchor = anchors[i]; 383 if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){ 384 imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title'))); 385 } 386 } 387 imageArray.removeDuplicates(); 388 while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;} 389 } 390 391 // calculate top offset for the lightbox and display 392 var arrayPageScroll = getPageScroll(); 393 var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10); 394 395 Element.setTop('lightbox', lightboxTop); 396 Element.show('lightbox'); 397 398 this.changeImage(imageNum); 399 }, 400 401 // 402 // changeImage() 403 // Hide most elements and preload image in preparation for resizing image container. 404 // 405 changeImage: function(imageNum) { 406 407 activeImage = imageNum; // update global var 408 409 // hide elements during transition 410 if(animate){ Element.show('loading');} 411 Element.hide('lightboxImage');
412 Element.hide('hoverNav'); 413 Element.hide('prevLink'); 414 Element.hide('nextLink'); 415 Element.hide('imageDataContainer'); 416 Element.hide('numberDisplay'); 417 418 imgPreloader = new Image(); 419 420 // once image is preloaded, resize image container 421 imgPreloader.onload=function(){ 422 Element.setSrc('lightboxImage', imageArray[activeImage][0]); 423 myLightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height); 424 } 425 imgPreloader.src = imageArray[activeImage][0]; 426 }, 427 428 // 429 // resizeImageContainer() 430 // 431 resizeImageContainer: function( imgWidth, imgHeight) { 432 433 // get curren width and height 434 this.widthCurrent = Element.getWidth('outerImageContainer'); 435 this.heightCurrent = Element.getHeight('outerImageContainer'); 436 437 // get new width and height 438 var widthNew = (imgWidth + (borderSize * 2)); 439 var heightNew = (imgHeight + (borderSize * 2)); 440 441 // scalars based on change from old to new 442 this.xScale = ( widthNew / this.widthCurrent) * 100; 443 this.yScale = ( heightNew / this.heightCurrent) * 100; 444 445 // calculate size difference between new and old image, and resize if necessary 446 wDiff = this.widthCurrent - widthNew; 447 hDiff = this.heightCurrent - heightNew; 448 449 if(!( hDiff == 0)){ new Effect.Scale('outerImageContainer', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } 450 if(!( wDiff == 0)){ new Effect.Scale('outerImageContainer', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } 451 452 // if new and old image are same size and no scaling transition is necessary, 453 // do a quick pause to prevent image flicker. 454 if((hDiff == 0) && (wDiff == 0)){ 455 if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} 456 } 457 458 Element.setHeight('prevLink', imgHeight); 459 Element.setHeight('nextLink', imgHeight); 460 Element.setWidth( 'imageDataContainer', widthNew); 461 462 this.showImage(); 463 }, 464 465 // 466 // showImage() 467 // Display image and begin preloading neighbors. 468 // 469 showImage: function(){ 470 Element.hide('loading'); 471 new Effect.Appear('lightboxImage', { duration: resizeDuration, queue: 'end', afterFinish: function(){ myLightbox.updateDetails(); } }); 472 this.preloadNeighborImages(); 473 }, 474 475 // 476 // updateDetails() 477 // Display caption, image number, and bottom nav. 478 // 479 updateDetails: function() { 480 481 Element.show('caption'); 482 Element.setInnerHTML( 'caption', imageArray[activeImage][1]); 483 484 // if image is part of set display 'Image x of x' 485 if(imageArray.length > 1){ 486 Element.show('numberDisplay'); 487 Element.setInnerHTML( 'numberDisplay', "Image " + eval(activeImage + 1) + " of " + imageArray.length); 488 } 489 490 new Effect.Parallel( 491 [ new Effect.SlideDown( 'imageDataContainer', { sync: true, duration: resizeDuration, from: 0.0, to: 1.0 }), 492 new Effect.Appear('imageDataContainer', { sync: true, duration: resizeDuration }) ], 493 { duration: resizeDuration, afterFinish: function() { 494 // update overlay size and update nav 495 var arrayPageSize = getPageSize(); 496 Element.setHeight('overlay', arrayPageSize[1]); 497 myLightbox.updateNav(); 498 } 499 } 500 ); 501 }, 502 503 // 504 // updateNav() 505 // Display appropriate previous and next hover navigation. 506 // 507 updateNav: function() { 508 509 Element.show('hoverNav'); 510 511 // if not first image in set, display prev image button 512 if(activeImage != 0){ 513 Element.show('prevLink'); 514 document.getElementById('prevLink').onclick = function() { 515 myLightbox.changeImage(activeImage - 1); return false; 516 } 517 } 518 519 // if not last image in set, display next image button 520 if(activeImage != (imageArray.length - 1)){ 521 Element.show('nextLink'); 522 document.getElementById('nextLink').onclick = function() { 523 myLightbox.changeImage(activeImage + 1); return false; 524 } 525 } 526 527 this.enableKeyboardNav(); 528 }, 529 530 // 531 // enableKeyboardNav() 532 // 533 enableKeyboardNav: function() { 534 document.onkeydown = this.keyboardAction; 535 }, 536 537 // 538 // disableKeyboardNav() 539 // 540 disableKeyboardNav: function() { 541 document.onkeydown = ''; 542 }, 543 544 // 545 // keyboardAction() 546 // 547 keyboardAction: function(e) { 548 if (e == null) { // ie 549 keycode = event.keyCode; 550 escapeKey = 27; 551 } else { // mozilla 552 keycode = e.keyCode; 553 escapeKey = e.DOM_VK_ESCAPE; 554 } 555 556 key = String.fromCharCode(keycode).toLowerCase(); 557 558 if((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)){ // close lightbox 559 myLightbox.end(); 560 } else if((key == 'p') || (keycode == 37)){ // display previous image 561 if(activeImage != 0){ 562 myLightbox.disableKeyboardNav(); 563 myLightbox.changeImage(activeImage - 1); 564 } 565 } else if((key == 'n') || (keycode == 39)){ // display next image 566 if(activeImage != (imageArray.length - 1)){ 567 myLightbox.disableKeyboardNav(); 568 myLightbox.changeImage(activeImage + 1); 569 } 570 } 571 572 }, 573 574 // 575 // preloadNeighborImages() 576 // Preload previous and next images. 577 // 578 preloadNeighborImages: function(){ 579 580 if((imageArray.length - 1) > activeImage){ 581 preloadNextImage = new Image(); 582 preloadNextImage.src = imageArray[activeImage + 1][0]; 583 } 584 if(activeImage > 0){ 585 preloadPrevImage = new Image(); 586 preloadPrevImage.src = imageArray[activeImage - 1][0]; 587 } 588 589 }, 590 591 // 592 // end() 593 // 594 end: function() { 595 this.disableKeyboardNav(); 596 Element.hide('lightbox'); 597 new Effect.Fade('overlay', { duration: overlayDuration}); 598 showSelectBoxes(); 599 showFlash(); 600 } 601} 602 603// ----------------------------------------------------------------------------------- 604 605// 606// getPageScroll() 607// Returns array with x,y page scroll values. 608// Core code from - quirksmode.org 609// 610function getPageScroll(){ 611 612 var yScroll; 613 614 if (self.pageYOffset) { 615 yScroll = self.pageYOffset; 616 } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict 617 yScroll = document.documentElement.scrollTop; 618 } else if (document.body) {// all other Explorers 619 yScroll = document.body.scrollTop; 620 } 621 622 arrayPageScroll = new Array('',yScroll) 623 return arrayPageScroll; 624} 625 626// ----------------------------------------------------------------------------------- 627 628// 629// getPageSize() 630// Returns array with page width, height and window width, height 631// Core code from - quirksmode.org 632// Edit for Firefox by pHaez 633// 634function getPageSize(){ 635 636 var xScroll, yScroll; 637 638 if (window.innerHeight && window.scrollMaxY) { 639 xScroll = document.body.scrollWidth; 640 yScroll = window.innerHeight + window.scrollMaxY; 641 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 642 xScroll = document.body.scrollWidth; 643 yScroll = document.body.scrollHeight; 644 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 645 xScroll = document.body.offsetWidth; 646 yScroll = document.body.offsetHeight; 647 } 648 649 var windowWidth, windowHeight;
650 if (self.innerHeight) { // all except Explorer 651 windowWidth = self.innerWidth; 652 windowHeight = self.innerHeight; 653 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 654 windowWidth = document.documentElement.clientWidth; 655 windowHeight = document.documentElement.clientHeight; 656 } else if (document.body) { // other Explorers 657 windowWidth = document.body.clientWidth; 658 windowHeight = document.body.clientHeight; 659 } 660 661 // for small pages with total height less then height of the viewport 662 if(yScroll < windowHeight){ 663 pageHeight = windowHeight; 664 } else { 665 pageHeight = yScroll; 666 } 667 668 // for small pages with total width less then width of the viewport 669 if(xScroll < windowWidth){ 670 pageWidth = windowWidth; 671 } else { 672 pageWidth = xScroll; 673 } 674 675 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 676 return arrayPageSize; 677} 678 679// ----------------------------------------------------------------------------------- 680 681// 682// getKey(key) 683// Gets keycode. If 'x' is pressed then it hides the lightbox. 684// 685function getKey(e){ 686 if (e == null) { // ie 687 keycode = event.keyCode; 688 } else { // mozilla 689 keycode = e.which; 690 } 691 key = String.fromCharCode(keycode).toLowerCase(); 692 693 if(key == 'x'){ 694 } 695} 696 697// ----------------------------------------------------------------------------------- 698 699// 700// listenKey() 701// 702function listenKey () { document.onkeypress = getKey; } 703 704// --------------------------------------------------- 705 706function showSelectBoxes(){ 707 var selects = document.getElementsByTagName("select"); 708 for (i = 0; i != selects.length; i++) { 709 selects[i].style.visibility = "visible"; 710 } 711} 712 713// --------------------------------------------------- 714 715function hideSelectBoxes(){ 716 var selects = document.getElementsByTagName("select"); 717 for (i = 0; i != selects.length; i++) { 718 selects[i].style.visibility = "hidden"; 719 } 720} 721 722// --------------------------------------------------- 723 724function showFlash(){ 725 var flashObjects = document.getElementsByTagName("object"); 726 for (i = 0; i != flashObjects.length; i++) { 727 flashObjects[i].style.visibility = "visible"; 728 } 729 730 var flashEmbeds = document.getElementsByTagName("embeds"); 731 for (i = 0; i != flashEmbeds.length; i++) { 732 flashEmbeds[i].style.visibility = "visible"; 733 } 734} 735 736// --------------------------------------------------- 737 738function hideFlash(){ 739 var flashObjects = document.getElementsByTagName("object"); 740 for (i = 0; i != flashObjects.length; i++) { 741 flashObjects[i].style.visibility = "hidden"; 742 } 743 744 var flashEmbeds = document.getElementsByTagName("embeds"); 745 for (i = 0; i != flashEmbeds.length; i++) { 746 flashEmbeds[i].style.visibility = "hidden"; 747 } 748 749} 750 751 752// --------------------------------------------------- 753 754// 755// pause(numberMillis) 756// Pauses code execution for specified time. Uses busy code, not good. 757// Help from Ran Bar-On [[email protected]] 758// 759 760function pause(ms){ 761 var date = new Date(); 762 curDate = null; 763 do{var curDate = new Date();} 764 while( curDate - date < ms); 765} 766/* 767function pause(numberMillis) { 768 var curently = new Date().getTime() + sender; 769 while (new Date().getTime(); 770} 771*/ 772// --------------------------------------------------- 773 774 775 776function initLightbox() { myLightbox = new Lightbox(); } 777Event.observe(window, 'load', initLightbox, false);
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.