PageSourceSearch

https://mst.hu/jscript/lightbox/lightbox.js?v=2

js mst.hu collected 2026-09-29 13:48:27 UTC 23,856 bytes, 791 lines download raw bytes

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