1(function(b){b.fn.lightbox=function(h){function d(){b("#overlay, #lightbox").remove();a.inprogress=!1;if(a.jsonData&&0<a.jsonData.length){var e=a.jsonDataParser?a.jsonDataParser:b.fn.lightbox.parseJsonData;a.imageArray=[];a.imageArray=e(a.jsonData)}var e='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe"></iframe><img id="lightboxImage" /><div id="hoverNav"><a href="javascript://" title="'+a.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+ 2a.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><img src="'+a.fileLoadingImage+'"></a></div></div></div>',c='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';a.displayHelp&&(c+='<span id="helpDisplay">'+a.strings.help+"</span>");c+='<a href="javascript://" id="bottomNavClose" title="'+a.strings.closeTitle+'"><img src="'+a.fileBottomNavCloseImage+ 3'"></a></div></div></div>';a.navbarOnTop?(b("body").append('<div id="overlay"></div><div id="lightbox">'+c+e+"</div>"),b("#imageDataContainer").addClass("ontop")):b("body").append('<div id="overlay"></div><div id="lightbox">'+e+c+"</div>");b("#overlay, #lightbox").click(function(){m()}).hide();b("#loadingLink, #bottomNavClose").click(function(){m();return false});b("#outerImageContainer").width(a.widthCurrent).height(a.heightCurrent);b("#imageDataContainer").width(a.widthCurrent);a.imageClickClose|| 4(b("#lightboxImage").click(function(){return false}),b("#hoverNav").click(function(){return false}));return!0}function k(){var a,b;self.pageYOffset?(b=self.pageYOffset,a=self.pageXOffset):document.documentElement&&document.documentElement.scrollTop?(b=document.documentElement.scrollTop,a=document.documentElement.scrollLeft):document.body&&(b=document.body.scrollTop,a=document.body.scrollLeft);return[a,b]}function o(e){b("select, embed, object").hide();n();b("#overlay").hide().css({opacity:a.overlayOpacity}).fadeIn(); 5imageNum=0;a.jsonData||(a.imageArray=[],(!e.rel||""==e.rel)&&!a.allSet?a.imageArray.push([e.href,a.displayTitle?e.title:""]):b("a").each(function(){this.href&&this.rel==e.rel&&a.imageArray.push([this.href,a.displayTitle?this.title:""])}));if(1<a.imageArray.length){for(i=0;i<a.imageArray.length;i++)for(j=a.imageArray.length-1;j>i;j--)a.imageArray[i][0]==a.imageArray[j][0]&&a.imageArray.splice(j,1);for(;a.imageArray[imageNum][0]!=e.href;)imageNum++}var c=k(),f=c[1]+b(window).height()/10,c=c[0];b("#lightbox").css({top:f+ 6"px",left:c+"px"}).show();a.slideNavBar||b("#imageData").hide();g(imageNum)}function g(e){!1==a.inprogress&&(a.inprogress=!0,a.activeImage=e,b("#loading").show(),b("#lightboxImage, #hoverNav, #prevLink, #nextLink").hide(),a.slideNavBar&&(b("#imageDataContainer").hide(),b("#imageData").hide()),p())}function p(){imgPreloader=new Image;imgPreloader.onload=function(){var e=imgPreloader.width,c=imgPreloader.height;a.scaleImages&&(e=parseInt(a.xScale*e),c=parseInt(a.yScale*c));if(a.fitToScreen){var f;f= 7[b(document).width(),b(document).height(),b(window).width(),b(window).height()];var d=f[2]-2*a.borderSize;f=f[3]-200;var q=d/f,g=imgPreloader.width/imgPreloader.height;if(imgPreloader.height>f||imgPreloader.width>d)q>g?(e=parseInt(f/imgPreloader.height*imgPreloader.width),c=f):(c=parseInt(d/imgPreloader.width*imgPreloader.height),e=d)}b("#lightboxImage").attr("src",a.imageArray[a.activeImage][0]).width(e).height(c);r(e,c)};imgPreloader.src=a.imageArray[a.activeImage][0]}function m(){l();b("#lightbox").hide(); 8b("#overlay").fadeOut();b("select, object, embed").show()}function r(e,c){a.widthCurrent=b("#outerImageContainer").outerWidth();a.heightCurrent=b("#outerImageContainer").outerHeight();var f=Math.max(350,e+2*a.borderSize),d=c+2*a.borderSize;wDiff=a.widthCurrent-f;hDiff=a.heightCurrent-d;b("#imageDataContainer").animate({width:f},a.resizeSpeed,"linear");b("#outerImageContainer").animate({width:f},a.resizeSpeed,"linear",function(){b("#outerImageContainer").animate({height:d},a.resizeSpeed,"linear",function(){b("#loading").hide(); 9b("#lightboxImage").fadeIn("fast");b("#numberDisplay").html("");a.imageArray[a.activeImage][1]&&b("#caption").html(a.imageArray[a.activeImage][1]).show();if(1<a.imageArray.length){var c;c=a.strings.image+(a.activeImage+1)+a.strings.of+a.imageArray.length;a.displayDownloadLink&&(c+="<a href='"+a.imageArray[a.activeImage][0]+"'>"+a.strings.download+"</a>");if(!a.disableNavbarLinks){if(0<a.activeImage||a.loopImages)c='<a title="'+a.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+a.strings.prevLinkText+ 10"</a>"+c;if(a.activeImage+1<a.imageArray.length||a.loopImages)c+='<a title="'+a.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+a.strings.nextLinkText+"</a>"}b("#numberDisplay").html(c).show()}a.slideNavBar?b("#imageData").slideDown(a.navBarSlideSpeed):b("#imageData").show();n();s();if(a.loopImages&&1<a.imageArray.length)preloadNextImage=new Image,preloadNextImage.src=a.imageArray[a.activeImage==a.imageArray.length-1?0:a.activeImage+1][0],preloadPrevImage=new Image,preloadPrevImage.src=a.imageArray[0== 11a.activeImage?a.imageArray.length-1:a.activeImage-1][0];else if(a.imageArray.length-1>a.activeImage&&(preloadNextImage=new Image,preloadNextImage.src=a.imageArray[a.activeImage+1][0]),0<a.activeImage)preloadPrevImage=new Image,preloadPrevImage.src=a.imageArray[a.activeImage-1][0];a.inprogress=!1})});afterTimeout=function(){b("#prevLink").height(c);b("#nextLink").height(c)};0==hDiff&&0==wDiff?jQuery.browser.msie?setTimeout(afterTimeout,250):setTimeout(afterTimeout,100):afterTimeout()}function n(){b("#overlay").css({width:b(document).width(), 12height:b(document).height()})}function s(){1<a.imageArray.length&&(b("#hoverNav").show(),a.loopImages?(b("#prevLink,#prevLinkText").show().click(function(){g(0==a.activeImage?a.imageArray.length-1:a.activeImage-1);return!1}),b("#nextLink,#nextLinkText").show().click(function(){g(a.activeImage==a.imageArray.length-1?0:a.activeImage+1);return!1})):(0!=a.activeImage&&b("#prevLink,#prevLinkText").show().click(function(){g(a.activeImage-1);return!1}),a.activeImage!=a.imageArray.length-1&&b("#nextLink,#nextLinkText").show().click(function(){g(a.activeImage+ 131);return!1})));b(document).bind("keydown",{opts:a},t)}function t(b){var c=b.data.opts,b=b.keyCode,d=String.fromCharCode(b).toLowerCase();if("x"==d||"o"==d||"c"==d||27==b)m();else if("p"==d||37==b)c.loopImages?(l(),g(0==c.activeImage?c.imageArray.length-1:c.activeImage-1)):0!=c.activeImage&&(l(),g(c.activeImage-1));else if("n"==d||39==b)a.loopImages?(l(),g(c.activeImage==c.imageArray.length-1?0:c.activeImage+1)):c.activeImage!=c.imageArray.length-1&&(l(),g(c.activeImage+1))}function l(){b(document).unbind("keydown")} 14var a=b.extend({},b.fn.lightbox.defaults,h);b(window).resize(n);return b(this).live(a.triggerEvent,function(){d();o(this);return!1})};b.fn.lightbox.parseJsonData=function(h){var d=[];b.each(h,function(){d.push([this.url,this.title])});return d};b.fn.lightbox.defaults={triggerEvent:"click",allSet:!1,fileLoadingImage:"images/loading.gif",fileBottomNavCloseImage:"images/closelabel.gif",overlayOpacity:0.6,borderSize:10,imageArray:[],activeImage:null,inprogress:!1,resizeSpeed:350,widthCurrent:250,heightCurrent:250, 15scaleImages:!1,xScale:1,yScale:1,displayTitle:!0,navbarOnTop:!1,displayDownloadLink:!1,slideNavBar:!1,navBarSlideSpeed:350,displayHelp:!1,strings:{help:" ← / P - previous image → / N - next image ESC / X - close image gallery",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"« Previous",nextLinkText:"Next »",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"},fitToScreen:!1,disableNavbarLinks:!1,loopImages:!1,imageClickClose:!0,jsonData:null, 16jsonDataParser:null}})(jQuery);jQuery(function(b){var h=[];b("a[class=media]").each(function(){var d=b(this).find("img");if(d.length){var d=d[0],k=d.src,k=k.replace(/\?w=\d+&?/,"?");h.push([k,d.title||""]);this.href=k}else return!1}).lightbox({fileLoadingImage:DOKU_BASE+"lib/plugins/lightbox/images/loading.gif",fileBottomNavCloseImage:DOKU_BASE+"lib/plugins/lightbox/images/closelabel.gif",fitToScreen:!0,jsonData:h,jsonDataParser:function(b){return b}})}); 17