﻿/**
* This file is part of jQuery Lightbox
* Copyright (C) 2007-2010 Benjamin Arthur Lupton
* http://www.balupton.com/projects/jquery-lightbox
*
* jQuery Lightbox is free software; You can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License version 3 as published by the Free Software Foundation.
* You don't have to do anything special to accept the license and you don’t have to notify
* anyone which that you have made that decision.
* 
* jQuery Lightbox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See your chosen license for more details.
* 
* You should have received along with jQuery Lightbox:
* - A copy of the license used.
*   If not, see <http://www.gnu.org/licenses/agpl-3.0.html>.
* - A copy of our interpretation of the license used.
*   If not, see <http://github.com/balupton/jquery-lightbox/blob/master/COPYING.txt>.
* 
* @version 1.4.6-final- But it is 1.4.9 version
* @date July 28, 2010
* @since v0.1.0-dev, December 3, 2007
* @category jquery-plugin
* @package jquery-lightbox {@link http://www.balupton/projects/jquery-lightbox}
* @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
* @copyright (c) 2007-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
* @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
* @example Visit {@link http://www.balupton.com/projects/jquery-lightbox} for more information.
*/



(function($){if(typeof window.console!=="object"||typeof window.console.emulated==="undefined"){if(typeof window.console!=="object"||!(typeof window.console.log==="function"||typeof window.console.log==="object")){window.console={};window.console.log=window.console.debug=window.console.warn=window.console.trace=function(){};window.console.error=function(){var msg="An error has occured. More information will be available in the console log.";for(var i=0;i<arguments.length;++i){if(typeof arguments[i]!=="string"){break;}msg+="\n"+arguments[i];}if(typeof Error!=="undefined"){throw new Error(msg);}else{throw (msg);}};}else{if(typeof window.console.debug==="undefined"){window.console.debug=function(){var arr=["console.debug:"];for(var i=0;i<arguments.length;i++){arr.push(arguments[i]);}window.console.log.apply(window.console,arr);};}if(typeof window.console.warn==="undefined"){window.console.warn=function(){var arr=["console.warn:"];for(var i=0;i<arguments.length;i++){arr.push(arguments[i]);}window.console.log.apply(window.console,arr);};}if(typeof window.console.error==="undefined"){window.console.error=function(){var arr=["console.error"];for(var i=0;i<arguments.length;i++){arr.push(arguments[i]);}window.console.log.apply(window.console,arr);};}if(typeof window.console.trace==="undefined"){window.console.trace=function(){window.console.error.apply(window.console,["console.trace does not exist"]);};}}window.console.emulated=true;}String.prototype.queryStringToJSON=String.prototype.queryStringToJSON||function(){var params=String(this);params=params.substring(params.indexOf("?")+1);params=params.replace(/\+/g,"%20");if(params.substring(0,1)==="{"&&params.substring(params.length-1)==="}"){return eval(decodeURIComponent(params));}params=params.split(/\&(amp\;)?/);var json={};for(var i=0,n=params.length;i<n;++i){var param=params[i]||null;if(param===null){continue;}param=param.split("=");if(param===null){continue;}var key=param[0]||null;if(key===null){continue;}if(typeof param[1]==="undefined"){continue;}var value=param[1];key=decodeURIComponent(key);value=decodeURIComponent(value);try{value=eval(value);}catch(e){}var keys=key.split(".");if(keys.length===1){json[key]=value;}else{var path="",cmd="";$.each(keys,function(ii,key){path+='["'+key.replace(/"/g,'\\"')+'"]';jsonCLOSUREGLOBAL=json;cmd="if ( typeof jsonCLOSUREGLOBAL"+path+' === "undefined" ) jsonCLOSUREGLOBAL'+path+" = {}";eval(cmd);json=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL;});jsonCLOSUREGLOBAL=json;valueCLOSUREGLOBAL=value;cmd="jsonCLOSUREGLOBAL"+path+" = valueCLOSUREGLOBAL";eval(cmd);json=jsonCLOSUREGLOBAL;delete jsonCLOSUREGLOBAL;delete valueCLOSUREGLOBAL;}}return json;};Array.prototype.remove=function(from,to){var rest=this.slice((to||from)+1||this.length);this.length=from<0?this.length+from:from;return this.push.apply(this,rest);};Array.prototype.get=function(index,current){if(index==="first"){index=0;}else{if(index==="last"){index=this.length-1;}else{if(index==="prev"){index=this.index-1;}else{if(index==="next"){index=this.index+1;}else{if(!index&&index!==0){index=this.index;}}}}}if(current||false!==false){this.setIndex(index);}return this.exists(index)?this[index]:undefined;};Array.prototype.each=function(fn){for(var i=0;i<this.length;++i){if(fn(i,this[i],this)===false){break;}}return this;};Array.prototype.validIndex=function(index){return index>=0&&index<this.length;};Array.prototype.setIndex=function(index){if(this.validIndex(index)){this.index=index;}else{this.index=null;}return this;};Array.prototype.current=function(index){return this.get(index,true);};Array.prototype.isEmpty=function(){return this.length===0;};Array.prototype.isSingle=function(){return this.length===1;};Array.prototype.isNotEmpty=function(){return this.length!==0;};Array.prototype.isNotEmpty=function(){return this.length>1;};Array.prototype.isLast=function(index){index=typeof index==="undefined"?this.index:index;return !this.isEmpty()&&index===this.length-1;};Array.prototype.isFirst=function(index){index=typeof index==="undefined"?this.index:index;return !this.isEmpty()&&index===0;};Array.prototype.clear=function(){this.length=0;};Array.prototype.next=function(update){return this.get(this.index+1,update);};Array.prototype.prev=function(update){return this.get(this.index-1,update);};Array.prototype.reset=function(){this.index=null;return this;};Array.prototype.set=function(index,item){if(index<this.length&&index>=0){this[index]=item;}else{throw new Error("Array.prototype.set: [index] above this.length");}return this;};Array.prototype.loop=function(){if(!this.index&&this.index!==0){return this.current(0);}return this.next();};Array.prototype.add=function(){this.push.apply(this,arguments);return this;};Array.prototype.insert=function(index,item){if(typeof index!=="number"){index=this.length;}index=index<=this.length?index:this.length;var rest=this.slice(index);this.length=index;this.push(item);this.push.apply(this,rest);return this;};Array.prototype.exists=Array.prototype.exists||function(index){return typeof this[index]!=="undefined";};Array.prototype.has=Array.prototype.has||function(value){var has=false;for(var i=0,n=this.length;i<n;++i){if(value==this[i]){has=true;break;}}return has;};$.fn.once=$.fn.once||function(event,data,callback){var $this=$(this);if((callback||false)){$this.unbind(event,callback);$this.bind(event,data,callback);}else{callback=data;$this.unbind(event,callback);$this.bind(event,callback);}return $this;};$.fn.binder=$.fn.binder||function(event,data,callback){var $this=$(this);if((callback||false)){$this.bind(event,data,callback);}else{callback=data;$this.bind(event,callback);}return $this;};$.fn.lastclick=$.fn.lastclick||function(data,callback){return $(this).binder("lastclick",data,callback);};$.event.special.lastclick=$.event.special.lastclick||{setup:function(data,namespaces){$(this).bind("click",$.event.special.lastclick.handler);},teardown:function(namespaces){$(this).unbind("click",$.event.special.lastclick.handler);},handler:function(event){var clear=function(){var Me=this;var $el=$(Me);var timeout=$el.data("lastclick-timeout")||false;if(timeout){clearTimeout(timeout);}timeout=false;$el.data("lastclick-timeout",timeout);};var check=function(event){var Me=this;clear.call(Me);var $el=$(Me);$el.data("lastclick-clicks",($el.data("lastclick-clicks")||0)+1);var timeout=setTimeout(function(){var clicks=$el.data("lastclick-clicks");clear.apply(Me,[event]);$el.data("lastclick-clicks",0);event.type="lastclick";try{$.event.handle.apply(Me,[event,clicks]);}catch(e){}},300);$el.data("lastclick-timeout",timeout);};check.apply(this,[event]);}};$.fn.preventDefault=$.fn.preventDefault||function(){return $(this).click(function(event){event.preventDefault();return false;});};$.LightboxClass=function(){this.construct();};$.fn.lightbox=function(options){$.Lightbox=$.Lightbox||new $.LightboxClass();if($.Lightbox.ie6&&!$.Lightbox.ie6_support){return this;}options=$.extend({start:false,events:true},options);var $group=$(this);if(options.events){$group.preventDefault().once("lastclick",function(event){var $obj=$(this);var index=$group.index($obj);if(!$.Lightbox.init(index,$group)){return false;}if(!$.Lightbox.start()){return false;}event.preventDefault();return false;});$group.addClass("lightbox-enabled");}if(options.start){var obj=$(this);if(!$.Lightbox.init(0,$group)){return this;}if(!$.Lightbox.start()){return this;}}return this;};$.extend($.LightboxClass.prototype,{images:[],constructed:false,compressed:null,src:null,baseurl:null,files:{compressed:{scripts:{},styles:{}},uncompressed:{scripts:{lightbox:"/syn/assets/script/jquery.lightbox.js",colorBlend:"/syn/assets/script/jquery.color.js"},styles:{lightbox:"/syn/assets/style/jquery.lightbox.css"}},images:{prev:"/syn/assets/img/gallery/prev.gif",next:"/syn/assets/img/gallery/next.gif",blank:"/syn/assets/img/gallery/blank.gif",loading:"/syn/assets/img/gallery/loading.gif"}},text:{image:"Image",of:"of",close:"Close window",closeInfo:"You can also click anywhere outside the image to close.",download:"Direct link to download the image",help:{close:"Click to close",interact:"Hover to interact"},about:{text:"jQuery Lightbox Plugin (balupton edition)",title:"Licenced under the GNU Affero General Public License.",link:"http://www.balupton.com/projects/jquery-lightbox"}},keys:{close:"c",prev:"p",next:"n"},handlers:{show:null},opacity:0.9,padding:null,speed:400,rel:"lightbox",auto_relify:true,auto_scroll:"follow",auto_resize:true,ie6:null,ie6_support:true,colorBlend:null,download_link:true,show_helper_text:true,show_linkback:true,show_info:"auto",show_extended_info:"auto",options:["show_helper_text","auto_scroll","auto_resize","download_link","show_info","show_extended_info","ie6_support","colorBlend","baseurl","files","text","show_linkback","keys","opacity","padding","speed","rel","auto_relify"],construct:function(options){var initial=typeof this.constructed==="undefined"||this.constructed===false;this.constructed=true;var domReady=initial;options=options||{};var prepend=function(item,value){if(typeof item==="object"){for(var i in item){item[i]=prepend(item[i],value);}}else{if(typeof value==="array"){for(var i=0,n=item.length;i<n;++i){item[i]=prepend(item[i],value);}}else{item=value+item;}}return item;};if(initial&&(typeof options.files==="undefined")){this.compressed=null;var $script=$("script[src*="+this.files.compressed.scripts.lightbox+"]:first");if($script.length!==0){$.extend(true,this.files,this.files.compressed);this.compressed=true;}else{$script=$("script[src*="+this.files.uncompressed.scripts.lightbox+"]:first");if($script.length!==0){$.extend(true,this.files,this.files.uncompressed);this.compressed=false;}else{}}if(this.compressed===null){window.console.error("Lightbox was not able to find it's javascript script tag necessary for auto-inclusion.");domReady=false;}else{this.src=$script.attr("src");this.baseurl=this.src.substring(0,this.src.indexOf(this.files.scripts.lightbox));this.files=prepend(this.files,this.baseurl);options=$.extend(options,this.src.queryStringToJSON());}this.images.image={src:"",title:"Untitled",description:"",name:"",color:null,width:null,height:null,id:null,image:true};this.images.prepare=function(obj){var image=$.extend({},this.image);if(obj.tagName){obj=$(obj);if(obj.attr("src")||obj.attr("href")){image.src=obj.attr("src")||obj.attr("href");image.title=obj.attr("title")||obj.attr("alt")||image.title;image.name=obj.attr("name")||"";image.color=obj.css("backgroundColor");var s=image.title.indexOf(": ");if(s>0){image.description=image.title.substring(s+2)||image.description;image.title=image.title.substring(0,s)||image.title;}}else{image=null;}}else{if(obj.src){image=$.extend(this.image,obj);}else{image=null;}}if(image){image.id=image.id||image.src+image.title+image.description;}return image;};this.images.create=function(obj){var images=this;if(obj.each){obj.each(function(index,item){images.create(item);});return;}var image=images.prepare(obj);if(!image){window.console.error("We dont know what we have:",obj,image);}else{images.push(image);}return images;};}else{if(typeof options.files==="object"){options.files=prepend(options.files,this.baseurl);}else{domReady=false;}}for(var i in this.options){var name=this.options[i];if((typeof options[name]==="object")&&(typeof this[name]==="object")){this[name]=$.extend(true,this[name],options[name]);}else{if(typeof options[name]!=="undefined"){this[name]=options[name];}}}delete i;if(initial&&navigator.userAgent.indexOf("MSIE 6")>=0){this.ie6=true;}else{this.ie6=false;}if(domReady||typeof options.download_link!=="undefined"||typeof options.colorBlend!=="undefined"||typeof options.files==="object"||typeof options.text==="object"||typeof options.show_linkback!=="undefined"||typeof options.scroll_with!=="undefined"){$(function(){$.Lightbox.domReady();});}return true;},domReady:function(){var bodyEl=document.getElementsByTagName($.browser.safari?"head":"body")[0];var stylesheets=this.files.styles;var scripts=this.files.scripts;if(this.colorBlend===true&&typeof $.colorBlend==="undefined"){this.colorBlend=true;}else{this.colorBlend=typeof $.colorBlend!=="undefined";delete scripts.colorBlend;}for(stylesheet in stylesheets){var linkEl=document.createElement("link");linkEl.type="text/css";linkEl.rel="stylesheet";linkEl.media="screen";linkEl.href=stylesheets[stylesheet];linkEl.id="lightbox-stylesheet-"+stylesheet.replace(/[^a-zA-Z0-9]/g,"");$("#"+linkEl.id).remove();bodyEl.appendChild(linkEl);}delete scripts.lightbox;for(script in scripts){var scriptEl=document.createElement("script");scriptEl.type="text/javascript";scriptEl.src=scripts[script];scriptEl.id="lightbox-script-"+script.replace(/[^a-zA-Z0-9]/g,"");$("#"+scriptEl.id).remove();bodyEl.appendChild(scriptEl);}delete scripts;delete stylesheets;delete bodyEl;$("#lightbox,#lightbox-overlay").remove();$("body").append('<div id="lightbox-overlay"></div><div id="lightbox"><div id="lightbox-imageBox"><div id="lightbox-imageContainer"><div id="lightbox-infoHeader"><h4 id="lightbox-caption"></h4></div><img id="lightbox-image" /><div id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+this.files.images.loading+'" /></a></div></div><div id="lightbox-infoBox"><div id="lightbox-infoContainer" class="clearfix"><div id="lightbox-infoFooter"><div id="lightbox-currentNumber"></div><div id="lightbox-download">Download: <a id="lightbox-download-low" href="#" title="'+this.text.download+'"><a id="lightbox-download-high" href="#" title="'+this.text.download+'"></a></div></div></div></div><div id="lightbox-close"><a href="#" id="lightbox-close-button" title="'+this.text.closeInfo+'">'+this.text.close+"</a></span></div></div>");this.resizeBoxes();this.repositionBoxes();$("#lightbox,#lightbox-overlay,#lightbox-overlay-text-interact").hide();if(this.ie6&&this.ie6_support){$("#lightbox-overlay").css({position:"absolute",top:"0px",left:"0px"});}$(window).unbind("resize").resize(function(){$.Lightbox.resizeBoxes("resized");});if(this.scroll==="follow"){$(window).scroll(function(){$.Lightbox.repositionBoxes();});}$("#lightbox-nav-btnPrev").unbind().preventDefault().hover(function(){$(this).css({background:"url("+$.Lightbox.files.images.prev+") left 45% no-repeat"});},function(){$(this).css({background:"transparent url("+$.Lightbox.files.images.blank+") no-repeat"});}).lastclick(function(){$.Lightbox.showImage("prev");return false;});$("#lightbox-nav-btnNext").unbind().preventDefault().hover(function(){$(this).css({background:"url("+$.Lightbox.files.images.next+") right 45% no-repeat"});},function(){$(this).css({background:"transparent url("+$.Lightbox.files.images.blank+") no-repeat"});}).lastclick(function(){$.Lightbox.showImage("next");return false;});if(this.show_linkback){$("#lightbox-overlay-text-about a").preventDefault().lastclick(function(){window.open($.Lightbox.text.about.link);return false;});}$("#lightbox-overlay-text-close").unbind().hover(function(){$("#lightbox-overlay-text-interact").fadeIn();},function(){$("#lightbox-overlay-text-interact").fadeOut();});$("#lightbox-download-low").click(function(){window.open($(this).attr("href"));return false;});$("#lightbox-download-high").click(function(){window.open($(this).attr("href"));return false;});$("#lightbox-overlay, #lightbox, #lightbox-loading-link, #lightbox-btnClose").unbind().preventDefault().lastclick(function(){$.Lightbox.finish();return false;});if(this.auto_relify){this.relify();}return true;},relify:function(){var groups={};var groups_n=0;var orig_rel=this.rel;$.each($("[rel*="+orig_rel+"]"),function(index,obj){var rel=$(obj).attr("rel");if(rel===orig_rel){rel=groups_n;}if(typeof groups[rel]==="undefined"){groups[rel]=[];groups_n++;}groups[rel].push(obj);});$.each(groups,function(index,group){$(group).lightbox();});return true;},init:function(image,images){if(typeof images==="undefined"){images=image;image=0;}this.images.clear();this.images.create(images);if(this.images.isEmpty()){window.console.warn("WARNING","Lightbox started, but no images: ",image,images);return false;}if(!this.images.current(image)){window.console.warn("WARNING","Could not find current image: ",image,this.images);return false;}return true;},start:function(){this.visible=true;if(this.scroll==="disable"){$(document.body).css("overflow","hidden");}$("embed, object, select").css("visibility","hidden");this.resizeBoxes("general");this.repositionBoxes({speed:0});$("#lightbox-infoFooter").hide();$("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext").hide();$("#lightbox-overlay").css("opacity",this.opacity).fadeIn(400,function(){$("#lightbox").fadeIn(300);if(!$.Lightbox.showImage()){$.Lightbox.finish();return false;}});return true;},finish:function(){$("#lightbox").hide();$("#lightbox-overlay").fadeOut(function(){$("#lightbox-overlay").hide();});$("embed, object, select").css({visibility:"visible"});this.images.reset();if(this.scroll==="disable"){$(document.body).css("overflow","visible");}this.visible=false;},resizeBoxes:function(type){if(type!=="transition"){var $body=$(this.ie6?document.body:document);$("#lightbox-overlay").css({width:$body.width(),height:$body.height()});delete $body;}switch(type){case"general":return true;break;case"resized":if(this.auto_resize===false){this.repositionBoxes({nHeight:nHeight,speed:this.speed});return true;}case"transition":default:break;}var image=this.images.current();if(!image||!image.width||!this.visible){return false;}var iWidth=image.width;var iHeight=image.height;var wWidth=$(window).width();var wHeight=$(window).height();if(this.auto_resize!==false){var maxWidth=Math.floor(wWidth*(4/5));var maxHeight=Math.floor(wHeight*(4/5));var resizeRatio;while(iWidth>maxWidth||iHeight>maxHeight){if(iWidth>maxWidth){resizeRatio=maxWidth/iWidth;iWidth=maxWidth;iHeight=Math.floor(iHeight*resizeRatio);}if(iHeight>maxHeight){resizeRatio=maxHeight/iHeight;iHeight=maxHeight;iWidth=Math.floor(iWidth*resizeRatio);}}}var cWidth=$("#lightbox-imageBox").width();var cHeight=$("#lightbox-imageBox").height();var nWidth=(iWidth+(this.padding*2));var nHeight=(iHeight+(this.padding*2));var dWidth=cWidth-nWidth;var dHeight=cHeight-nHeight;$("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css("height",nHeight);$("#lightbox-infoBox").css("width",nWidth);if(type==="transition"){if(dWidth===0&&dHeight===0){this.pause(this.speed/3);this.showImage(null,3);}else{$("#lightbox-image").height(iHeight);$("#lightbox-imageBox").animate({height:nHeight},this.speed,function(){$.Lightbox.showImage(null,3);});this.repositionBoxes({nHeight:nHeight,speed:this.speed});}}else{$("#lightbox-image").animate({height:iHeight},this.speed);$("#lightbox-imageBox").animate({height:nHeight},this.speed);}this.repositionBoxes({nHeight:nHeight,speed:this.speed});return true;},repositioning:false,reposition_failsafe:false,repositionBoxes:function(options){if(this.repositioning){this.reposition_failsafe=true;return null;}this.repositioning=true;options=$.extend({},options);options.callback=options.callback||null;options.speed=options.speed||"slow";var pageScroll=this.getPageScroll();var nHeight=options.nHeight||parseInt($("#lightbox").height(),10);var nTop=pageScroll.yScroll+($(window).height()-nHeight)/2.5;var nLeft=pageScroll.xScroll;var css={left:nLeft,top:nTop};if(options.speed){$("#lightbox").animate(css,"slow",function(){if($.Lightbox.reposition_failsafe){$.Lightbox.repositioning=$.Lightbox.reposition_failsafe=false;$.Lightbox.repositionBoxes(options);}else{$.Lightbox.repositioning=false;if(options.callback){options.callback();}}});}else{$("#lightbox").css(css);if(this.reposition_failsafe){this.repositioning=this.reposition_failsafe=false;this.repositionBoxes(options);}else{this.repositioning=false;}}return true;},visible:false,showImage:function(image,step){step=step||1;image=this.images.current(image)||this.images.get("first",true);if(!image){return;}switch(step){case 1:this.KeyboardNav_Disable();$("#lightbox-loading").show();$("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-infoFooter,#lightbox-close").hide();$("#lightbox-imageBox").unbind();if(image.width&&image.height){this.showImage(null,2);}else{if(image.src.queryStringToJSON().type=="image"){var preloader=new Image();preloader.onload=function(){image.width=preloader.width;image.height=preloader.height;$.Lightbox.showImage(null,2);preloader.onload=null;preloader=null;};preloader.src=image.src;}else{image.width=$.params_to_json(image.src).width;image.height=$.params_to_json(image.src).height;image.mediatype="flash";this.showImage(null,2);}}break;case 2:if(image.src.queryStringToJSON().type=="flash"){var flashvars={};var params={};params.menu="false";params.allowScriptAccess="sameDomain";var attributes={};attributes.id="lightbox-image";attributes.name="lightbox-image";swfobject.embedSWF(image.src,"lightbox-image",image.src.queryStringToJSON().width,image.src.queryStringToJSON().height,"9.0.0","",flashvars,params,attributes);}else{$("#lightbox-image").before('<img src="'+image.src+'" id="lightbox-image" alt="" style="display:none;" />').remove();}if(typeof this.padding==="undefined"||this.padding===null||isNaN(this.padding)){this.padding=($("#lightbox-imageContainer").css("padding-left"),10)||($("#lightbox-imageContainer").css("padding"),10)||0;}if(this.colorBlend){$("#lightbox-overlay").colorBlend([{param:"background-color",fromColor:$("#lightbox-overlay").css("background-color"),toColor:image.color,cycles:1,isFade:false}]);}this.resizeBoxes("transition");break;case 3:$("#lightbox-loading").hide();if(image.src.queryStringToJSON().type!="flash"){$("#lightbox-image").fadeIn(350,function(){$.Lightbox.showImage(null,4);});}else{this.showImage(null,4);}if(this.handlers.show!==null){this.handlers.show(image);}break;case 4:$("#lightbox-caption").html(image.title||"Untitled");if(image.src.queryStringToJSON().lo){$("#lightbox-download-low").html("Low resolution").attr("href",image.src.queryStringToJSON().lo);}if(image.src.queryStringToJSON().hi){$("#lightbox-download-high").html("High resolution").attr("href",image.src.queryStringToJSON().hi);}if(!image.src.queryStringToJSON().lo&&!image.src.queryStringToJSON().hi){$("#lightbox-download").hide();}else{$("#lightbox-download").show();}if(this.images.length>1){$("#lightbox-currentNumber").html(this.text.image+"&nbsp;"+(this.images.index+1)+"&nbsp;"+this.text.of+"&nbsp;"+this.images.length);}else{$("#lightbox-currentNumber").html("&nbsp;");}$("#lightbox-infoFooter").show();if(!this.images.isFirst()){$("#lightbox-nav-btnPrev").show();}if(!this.images.isLast()){$("#lightbox-nav-btnNext").show();}$("#lightbox-nav").show();$("#lightbox-close").show();this.KeyboardNav_Enable();break;default:window.console.error("Don't know what to do: ",image,step);return this.showImage(image,1);}return true;},preloadNeighbours:function(){if(this.images.isSingle()||this.images.isEmpty()){return true;}var image=this.images.current();var index=this.images.index;if(!image){return image;}var objNext;var prev=this.images.prev();if(prev){objNext=new Image();objNext.src=prev.src;}this.images.setIndex(index);var next=this.images.next();if(next){objNext=new Image();objNext.src=next.src;}this.images.setIndex(index);},KeyboardNav_Enable:function(){$(document).keydown(function(objEvent){$.Lightbox.KeyboardNav_Action(objEvent);});},KeyboardNav_Disable:function(){$(document).unbind("keydown");},KeyboardNav_Action:function(objEvent){objEvent=objEvent||window.event;var keycode=objEvent.keyCode;var escapeKey=objEvent.DOM_VK_ESCAPE||27;var key=String.fromCharCode(keycode).toLowerCase();if(key===this.keys.close||keycode===escapeKey){return $.Lightbox.finish();}if(key===this.keys.prev||keycode===37){return $.Lightbox.showImage("prev");}if(key===this.keys.next||keycode===39){return $.Lightbox.showImage("next");}return true;},getPageScroll:function(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else{if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}}}var arrayPageScroll={xScroll:xScroll,yScroll:yScroll};return arrayPageScroll;},pause:function(ms){var date=new Date();var curDate=null;do{curDate=new Date();}while(curDate-date<ms);}});if(typeof $.Lightbox==="undefined"){$.Lightbox=new $.LightboxClass();}})(jQuery);
