// $Id: jlightbox.js,v 1.3 2007/09/19 00:35:02 sun Exp $
// $ Lightbox
// Based on Lightbox v2.03.3 by Lokesh Dhakar
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 4={2j:\'/23/1J/1D/2m/29/18.1T\',1I:\'/23/1J/1D/2m/29/2w.1T\',1C:0.8,1b:\'2P\',I:10,h:u M,m:0,1i:\'2v\',1F:6(){4.1y();$("s").2p(\'<k q="S"></k> 			<k q="C"> 				<k q="T"> 					<k q="2M"> 						<1m q="19" 2H="E" /> 						<k 2F="" q="1o"> 							<a z="#" q="G"></a> 							<a z="#" q="H"></a> 						</k> 						<k q="18"> 							<a z="#" q="1M"> 								<1m L="\'+4.2j+\'" /> 							</a> 						</k> 					</k> 				</k> 				<k q="Z"> 					<k q="2x"> 						<k q="2u"> 							<Y q="1E"></Y> 							<Y q="1h"></Y> 						</k> 						<k q="2r"> 							<a z="#" q="1z"> 								<1m L="\'+4.1I+\'" /> 							</a> 						</k> 					</k> 				</k> 			</k>\');$(\'#S\').U(6(){4.W();A E}).D();$(\'#C\').D();$(\'#1M\').U(6(){4.W();A E});$(\'#1z\').U(6(){4.W();A E});$(\'#T\').F(1n).K(1n);$(\'#G\').1c({2i:4.I,2S:4.I});$(\'#H\').1c({2i:4.I,2R:4.I});$(\'#G\').U(6(){4.O(4.m-1);A E});$(\'#H\').U(6(){4.O(4.m+1);A E})},1y:6(){9 a=$(\'a\');9 b=$(\'2O\');X(9 i=0;i<a.v;i++){9 c=a[i];9 d=1k(c.12(\'V\'));5(c.12(\'z\')&&(d.1u().20(\'C\'))){c.1Z=6(){4.1l(l);A E}}}X(9 i=0;i<b.v;i++){9 e=b[i];9 d=1k(e.12(\'V\'));5(e.12(\'z\')&&(d.1u().20(\'C\'))){e.1Z=6(){4.1l(l);A E}}}},1l:6(a){$("1S, 1R, 1Q").D();9 b=4.1r();$(\'#S\').F(b[0]).K(b[1]);$(\'#S\').1c({2A:4.1C}).1N(4.1i);4.h=u M;11=0;9 c=$(a.2z);a=$(a);5((a.w(\'V\')==\'C\')){4.h.1L(u M(a.w(\'z\'),a.w(\'1K\')))}r{X(9 i=0;i<c.v;i++){9 d=$(c[i]);5(d.w(\'z\')&&(d.w(\'V\')==a.w(\'V\'))){4.h.1L(u M(d.w(\'z\'),d.w(\'1K\')))}}X(i=0;i<4.h.v;i++){X(9 j=4.h.v-1;j>i;j--){5(4.h[i][0]==4.h[j][0]){4.h.2y(j,1)}}}1H(4.h[11][0]!=a.w(\'z\')){11++}}9 e=4.1G();9 f=e[1]+(b[3]/10);9 g=e[0];$("#C").1c({2t:f,2s:g});$("#C").B();4.O(11)},O:6(a){4.m=a;$(\'#18\').B();$(\'#19, #1o, #Z, #1h\').D();16=u 13();16.1B=6(){$(\'#19\').w(\'L\',4.h[4.m][0]);4.1A(l.F,l.K);5($.1U.1V)16.1B=6(){}};16.L=4.h[4.m][0]},1A:6(a,b){l.1x=$(\'#T\').F();l.1X=$(\'#T\').K();l.17=(a+(4.I*2));l.1g=(b+(4.I*2));l.1w=l.1x-l.17;l.1v=l.1X-l.1g;5(l.1v!=0||l.1w!=0){$(\'#T\').2q({F:l.17,K:l.1g},4.1b,\'2o\',6(){4.1f()})}r{5($.1U.1V){4.1e(1n)}r{4.1e(2n)}4.1f()}$(\'#G, #H\').K(b);$(\'#G, #H\').F(1d(a/2));$(\'#Z\').F(l.17)},1f:6(){$(\'#18\').D();$(\'#19\').1N(4.1b,4.2l)},2l:6(){5(4.h[4.m][1]){$(\'#1E\').2k(4.h[4.m][1]).B()}5(4.h.v>1){$(\'#1h\').2k("13 "+2V(1d(4.m)+1)+" 2U "+4.h.v).B()}$("#Z").2T(4.1b,6(){$(\'#1o\').B();4.2h();9 a=4.1r();$(\'#S\').K(a[1]);4.2g();4.2f()})},2h:6(){5(4.m!=0){$(\'#G\').B()}r{$(\'#G\').D()}5(4.m!=(4.h.v-1)){$(\'#H\').B()}r{$(\'#H\').D()}},2f:6(){7.2e=4.2d},1a:6(){7.2e=\'\'},2d:6(e){5(e==2c){R=2Q.2a;1q=27}r{R=e.2a;1q=e.2N}Q=1k.2L(R).1u();5((Q==\'x\')||(Q==\'o\')||(Q==\'c\')||(R==1q)){4.W()}r 5((Q==\'p\')||(R==2K)){5(4.m!=0){4.1a();4.O(4.m-1)}}r 5((Q==\'n\')||(R==2J)){5(4.m!=(4.h.v-1)){4.1a();4.O(4.m+1)}}},2g:6(){5((4.h.v-1)>4.m){25=u 13();25.L=4.h[1d(4.m)+1][0]}5(4.m>0){24=u 13();24.L=4.h[1d(4.m)-1][0]}},W:6(){4.1a();$(\'#C\').D();$("#S").2I(4.1i);$("1S, 1Q, 1R").B()},1G:6(){9 a,t;5(N.22){t=N.22;a=N.2G}r 5(7.y&&7.y.1j){t=7.y.1j;a=7.y.21}r 5(7.s){t=7.s.1j;a=7.s.21}2b=u M(a,t);A 2b},1r:6(){9 a,t;5(P.14&&P.26){a=P.1Y+P.2E;t=P.14+P.26}r 5(7.s.1W>7.s.28){a=7.s.2D;t=7.s.1W}r{a=7.s.2C;t=7.s.28}9 b,J;5(N.14){5(7.y.15){b=7.y.15}r{b=N.1Y}J=N.14}r 5(7.y&&7.y.1p){b=7.y.15;J=7.y.1p}r 5(7.s){b=7.s.15;J=7.s.1p}5(t<J){1t=J}r{1t=t}5(a<b){1s=a}r{1s=b}1P=u M(1s,1t,b,J);A 1P},1e:6(a){9 b=u 1O();c=2c;2B{9 c=u 1O()}1H(c-b<a)}};$(7).2W(6(){4.1F()});',62,183,'||||Lightbox|if|function|document||var||||||||imageArray|||div|this|activeImage||||id|else|body|yScroll|new|length|attr||documentElement|href|return|show|lightbox|hide|false|width|prevLink|nextLink|borderSize|windowHeight|height|src|Array|self|changeImage|window|key|keycode|overlay|outerImageContainer|click|rel|end|for|span|imageDataContainer||imageNum|getAttribute|Image|innerHeight|clientWidth|imgPreloader|widthNew|loading|lightboxImage|disableKeyboardNav|resizeSpeed|css|parseInt|pause|showImage|heightNew|numberDisplay|overlaySpeed|scrollTop|String|start|img|250|hoverNav|clientHeight|escapeKey|getPageSize|pageWidth|pageHeight|toLowerCase|hDiff|wDiff|widthCurrent|updateImageList|bottomNavClose|resizeImageContainer|onload|overlayOpacity|modules|caption|initialize|getPageScroll|while|fileBottomNavCloseImage|all|title|push|loadingLink|fadeIn|Date|arrayPageSize|object|embed|select|gif|browser|msie|scrollHeight|heightCurrent|innerWidth|onclick|match|scrollLeft|pageYOffset|sites|preloadPrevImage|preloadNextImage|scrollMaxY||offsetHeight|images|keyCode|arrayPageScroll|null|keyboardAction|onkeydown|enableKeyboardNav|preloadNeighborImages|updateNav|paddingTop|fileLoadingImage|html|updateDetails|jlightbox|100|linear|append|animate|bottomNav|left|top|imageDetails|slow|closelabel|imageData|splice|tagName|opacity|do|offsetWidth|scrollWidth|scrollMaxX|style|pageXOffset|galleryimg|fadeOut|39|37|fromCharCode|imageContainer|DOM_VK_ESCAPE|area|normal|event|paddingRight|paddingLeft|slideDown|of|eval|ready'.split('|'),0,{}));

/* $Id: jlightbox.uncompressed.js,v 1.6 2009/08/02 01:49:14 sun Exp $ */
/**
 * $ Lightbox
 * @author
 *   Daniel F. Kudwien (sun), <http://www.unleashedmind.com>
 *   Warren Krewenki, <http://warren.mesozen.com>
 *
 * Based on Lightbox v2.03.3 by Lokesh Dhakar
 * <http://www.huddletogether.com/projects/lightbox2>
 *
 * Originally written using the Prototype framework and Script.aculo.us, now
 * re-written using $. This version tries to stay as much comparable to the
 * original script as possible. There will be another, experimental edition of
 * $ Lightbox leveraging the complete $ framework.
 */
var Lightbox = {
	fileLoadingImage: ROOT_PATH + 'image/jlightbox/loading.gif',
	fileBottomNavCloseImage: ROOT_PATH + 'image/jlightbox/close.gif',
	overlayOpacity: 0.8,
	resizeSpeed: 'normal',
	borderSize: 10,
	imageArray: new Array,
	activeImage: 0,
	overlaySpeed: 'slow', // shadow fade in/out duration
	
	initialize: function() {	
		
		Lightbox.updateImageList();
		
		// Attribute galleryimg="false" hides IE image toolbar.
		$("body").append('<div id="overlay"></div> \
			<div id="lightbox"> \
				<div id="outerImageContainer"> \
					<div id="imageContainer"> \
						<img id="lightboxImage" galleryimg="false" /> \
						<div style="" id="hoverNav"> \
							<a href="#" id="prevLink"></a> \
							<a href="#" id="nextLink"></a> \
						</div> \
						<div id="loading"> \
							<a href="#" id="loadingLink"> \
								<img src="'+ Lightbox.fileLoadingImage +'" /> \
							</a> \
						</div> \
					</div> \
				</div> \
				<div id="imageDataContainer"> \
					<div id="imageData"> \
						<div id="imageDetails"> \
							<span id="caption"></span> \
							<span id="numberDisplay"></span> \
						</div> \
						<div id="bottomNav"> \
							<a href="#" id="bottomNavClose"> \
								<img src="'+ Lightbox.fileBottomNavCloseImage +'" /> \
							</a> \
						</div> \
					</div> \
				</div> \
			</div>');
		$('#overlay').click(function(){ Lightbox.end(); return false; }).hide();
		$('#lightbox').click(function (e) {
			if (e.target.id == 'lightbox') {
				Lightbox.end();
			}
			return false;
		}).hide();
		$('#loadingLink').click(function(){ Lightbox.end(); return false; });
		$('#bottomNavClose').click(function(){ Lightbox.end(); return false; });
		$('#outerImageContainer').width(250).height(250);

		// Add padding for navigation links. 18/09/2007 sun
		$('#prevLink').css({ paddingTop: Lightbox.borderSize, paddingLeft: Lightbox.borderSize });
		$('#nextLink').css({ paddingTop: Lightbox.borderSize, paddingRight: Lightbox.borderSize });
		
		// Setup onclick handlers for previous and next buttons ONCE.
		// Lightbox wacks out if we reset those in updateNav(). 13/09/2007 sun
		$('#prevLink').click(function() {
				Lightbox.changeImage(Lightbox.activeImage - 1); return false;
		});
		$('#nextLink').click(function() {
				Lightbox.changeImage(Lightbox.activeImage + 1); return false;
		});
	},
	
	//
	// updateImageList()
	// Loops through anchor tags looking for 'lightbox' references and applies onclick
	// events to appropriate links. You can rerun after dynamically adding images w/ajax.
	//
	updateImageList: function() {	
		// attach lightbox to any links with rel 'lightbox'
		var anchors = $('a');
		var areas = $('area');

		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				anchor.onclick = function() { Lightbox.start(this); return false; };
			}
		}

		// loop through all area tags
		// todo: combine anchor & area tag loops
		for (var i=0; i< areas.length; i++){
			var area = areas[i];
			
			var relAttribute = String(area.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (area.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				area.onclick = function() { Lightbox.start(this); return false; };
			}
		}
	},
	
	//
	//	start()
	//	Display overlay and lightbox. If image is part of a set, add siblings to Lightbox.imageArray.
	//
	start: function(imageLink) {	
		$("select, embed, object").hide();
		
		// stretch overlay to fill page and fade in
		var arrayPageSize = Lightbox.getPageSize();
		// alert(arrayPageSize[0] +' ?= '+ $('body').width());
		// alert(arrayPageSize[1] +' ?= '+ $('body').height());
		$('#overlay').width(arrayPageSize[0]).height(arrayPageSize[1]);

		$('#overlay').css({opacity : Lightbox.overlayOpacity}).fadeIn(Lightbox.overlaySpeed);

		Lightbox.imageArray = new Array;
		imageNum = 0;		

		var anchors = $(imageLink.tagName);
		imageLink = $(imageLink);
	
		// if image is NOT part of a set..
		if((imageLink.attr('rel') == 'jlightbox')){
			// add single image to Lightbox.imageArray
			Lightbox.imageArray.push(new Array(imageLink.attr('href'), imageLink.attr('title')));			
		}
		// if image is part of a set..
		else {
			// loop through anchors, find other images in set, and add them to Lightbox.imageArray
			for (var i=0; i < anchors.length; i++){
				var anchor = $(anchors[i]);
				if (anchor.attr('href') && (anchor.attr('rel') == imageLink.attr('rel'))){
					Lightbox.imageArray.push(new Array(anchor.attr('href'), anchor.attr('title')));
				}
			}
			// remove duplicates
			// was: Array.prototype.removeDuplicates()
			for (i=0; i < Lightbox.imageArray.length; i++){
				for(var j = Lightbox.imageArray.length-1; j>i; j--){        
					if(Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]){
						Lightbox.imageArray.splice(j,1);
					}
				}
			}
			// determine number of clicked image
			while (Lightbox.imageArray[imageNum][0] != imageLink.attr('href')) { imageNum++;}
		}

		// calculate top and left offset for the lightbox 
		var arrayPageScroll = Lightbox.getPageScroll();
		var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10);
		var lightboxLeft = arrayPageScroll[0];
		$("#lightbox").css({top: lightboxTop, left: lightboxLeft});
		
		$("#lightbox").show();
		
		Lightbox.changeImage(imageNum);
	},

	//
	//	changeImage()
	//	Hide most elements and preload image in preparation for resizing image container.
	//
	changeImage: function(imageNum) {	
		// update global var
		Lightbox.activeImage = imageNum;

		// hide elements during transition
		$('#loading').show();
		$('#lightboxImage, #hoverNav, #imageDataContainer, #numberDisplay').hide();
		
		imgPreloader = new Image();
		
		// once image is preloaded, resize image container
		imgPreloader.onload=function(){
			$('#lightboxImage').attr('src', Lightbox.imageArray[Lightbox.activeImage][0]);
			Lightbox.resizeImageContainer(this.width, this.height);
			
			// clear onLoad, IE behaves irratically with animated gifs otherwise 
			if($.browser.msie) imgPreloader.onload=function(){};
		};
		imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
	},

	//
	//	resizeImageContainer()
	//
	resizeImageContainer: function(imgWidth, imgHeight) {
		
		// get current width and height
		this.widthCurrent = $('#outerImageContainer').width();
		this.heightCurrent = $('#outerImageContainer').height();

		// get new width and height
		this.widthNew = (imgWidth + (Lightbox.borderSize * 2));
		this.heightNew = (imgHeight + (Lightbox.borderSize * 2));

		// calculate size difference between new and old image, and resize if necessary
		this.wDiff = this.widthCurrent - this.widthNew;
		this.hDiff = this.heightCurrent - this.heightNew;

		if(this.hDiff != 0 || this.wDiff != 0){
			$('#outerImageContainer').animate({width: this.widthNew, height: this.heightNew}, Lightbox.resizeSpeed, 'linear', function() {
				Lightbox.showImage();
			});
		}
		else {
			// if new and old image are same size and no scaling transition is necessary, 
			// do a quick pause to prevent image flicker.
			if ($.browser.msie){ Lightbox.pause(250); } else { Lightbox.pause(100);} 
			Lightbox.showImage();
		}

		$('#prevLink, #nextLink').height(imgHeight);
		$('#prevLink, #nextLink').width(parseInt(imgWidth / 2));
		$('#imageDataContainer').width(this.widthNew);
	},
	
	//
	//	showImage()
	//	Display image and begin preloading neighbors.
	//
	showImage: function(){
		$('#loading').hide();
		$('#lightboxImage').fadeIn(Lightbox.resizeSpeed, Lightbox.updateDetails);
		// Moved preloadNeighborImages() to boost rendering.
	},

	//
	//	updateDetails()
	//	Display caption, image number, and bottom nav.
	//
	updateDetails: function() {
		// if caption is not null
		if(Lightbox.imageArray[Lightbox.activeImage][1]){
			$('#caption').html(Lightbox.imageArray[Lightbox.activeImage][1]).show();
		}
		else {
			$('#caption').hide();
		}
		
		// if image is part of set display 'Image x of x' 
		if(Lightbox.imageArray.length > 1){
			$('#numberDisplay').html("Image " + eval(parseInt(Lightbox.activeImage) + 1) + " of " + Lightbox.imageArray.length).show();
		}

		$("#imageDataContainer").slideDown(Lightbox.resizeSpeed, function() {
			// Usability optimization: Display image navigation first.
			$('#hoverNav').show();				
			Lightbox.updateNav();

			// update overlay size and update nav
			var arrayPageSize = Lightbox.getPageSize();
			$('#overlay').height(arrayPageSize[1]);

			Lightbox.preloadNeighborImages();
			Lightbox.enableKeyboardNav();
		});
	},

	//
	//	updateNav()
	//	Display appropriate previous and next hover navigation.
	//
	updateNav: function() {
		// Since we are working with global variables, onclick handlers are only
		// setup once in initialize(). 13/09/2007 sun

		// if not first image in set, display prev image button
		if(Lightbox.activeImage != 0) {
			$('#prevLink').show();
		}
		else {
			$('#prevLink').hide();
		}
		// if not last image in set, display next image button
		if(Lightbox.activeImage != (Lightbox.imageArray.length - 1)) {
			$('#nextLink').show();
		}
		else {
			$('#nextLink').hide();
		}
	},

	//
	//	enableKeyboardNav()
	//
	enableKeyboardNav: function() {
		document.onkeydown = Lightbox.keyboardAction; 
	},

	//
	//	disableKeyboardNav()
	//
	disableKeyboardNav: function() {
		document.onkeydown = '';
	},

	//
	//	keyboardAction()
	//
	keyboardAction: function(e) {
		if (e == null) { // ie
			keycode = event.keyCode;
			escapeKey = 27;
		} else { // mozilla
			keycode = e.keyCode;
			escapeKey = e.DOM_VK_ESCAPE;
		}

		key = String.fromCharCode(keycode).toLowerCase();
		
		if((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)){	// close lightbox
			Lightbox.end();
		} else if((key == 'p') || (keycode == 37)){	// display previous image
			if(Lightbox.activeImage != 0){
				Lightbox.disableKeyboardNav();
				Lightbox.changeImage(Lightbox.activeImage - 1);
			}
		} else if((key == 'n') || (keycode == 39)){	// display next image
			if(Lightbox.activeImage != (Lightbox.imageArray.length - 1)){
				Lightbox.disableKeyboardNav();
				Lightbox.changeImage(Lightbox.activeImage + 1);
			}
		}

	},

	//
	//	preloadNeighborImages()
	//	Preload previous and next images.
	//
	preloadNeighborImages: function() {
		if((Lightbox.imageArray.length - 1) > Lightbox.activeImage){
			preloadNextImage = new Image();
			preloadNextImage.src = Lightbox.imageArray[parseInt(Lightbox.activeImage) + 1][0];
		}
		if(Lightbox.activeImage > 0){
			preloadPrevImage = new Image();
			preloadPrevImage.src = Lightbox.imageArray[parseInt(Lightbox.activeImage) - 1][0];
		}
	},

	//
	//	end()
	//
	end: function() {
		// Try to prevent multiple fadeouts on double-click.
		// $('#overlay, #lightbox, #loadingLink').unbind('click');
		
		Lightbox.disableKeyboardNav();
		$('#lightbox').hide();
		$("#overlay").fadeOut(Lightbox.overlaySpeed);
		$("select, object, embed").show();
	},
	
// -----------------------------------------------------------------------------------

	//
	// getPageScroll()
	// Returns array with x,y page scroll values.
	// Core code from - quirksmode.com
	//
	getPageScroll : function(){
		
		var xScroll, yScroll;

		if (self.pageYOffset) {
			yScroll = self.pageYOffset;
			xScroll = self.pageXOffset;
		} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
			yScroll = document.documentElement.scrollTop;
			xScroll = document.documentElement.scrollLeft;
		} else if (document.body) {// all other Explorers
			yScroll = document.body.scrollTop;
			xScroll = document.body.scrollLeft;	
		}

		arrayPageScroll = new Array(xScroll,yScroll);
		return arrayPageScroll;
	},
	//
	// getPageSize()
	// Returns array with page width, height and window width, height
	// Core code from - quirksmode.com
	// Edit for Firefox by pHaez
	//
	getPageSize : function(){
		var xScroll, yScroll;

		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		var windowWidth, windowHeight;

		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	

		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}


		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
		return arrayPageSize;
	},
	//
	// pause(numberMillis)
	// Pauses code execution for specified time. Uses busy code, not good.
	// Help from Ran Bar-On [ran2103@gmail.com]
	//
	pause : function(ms){
		var date = new Date();
		curDate = null;
		do{var curDate = new Date();}
		while( curDate - date < ms);
	}
};

Lightbox.initialize();
