/*
 * Shadowbox.js, version 3.0.3
 * http://shadowbox-js.com/
 *
 * Copyright 2007-2010, Michael J. I. Jackson
 * Date: 2010-04-08 21:39:10 +0000
 */
(function(av,l){var R={version:"3.0.3"};var L=navigator.userAgent.toLowerCase();if(L.indexOf("windows")>-1||L.indexOf("win32")>-1){R.isWindows=true}else{if(L.indexOf("macintosh")>-1||L.indexOf("mac os x")>-1){R.isMac=true}else{if(L.indexOf("linux")>-1){R.isLinux=true}}}R.isIE=L.indexOf("msie")>-1;R.isIE6=L.indexOf("msie 6")>-1;R.isIE7=L.indexOf("msie 7")>-1;R.isGecko=L.indexOf("gecko")>-1&&L.indexOf("safari")==-1;R.isWebKit=L.indexOf("applewebkit/")>-1;var ac=/#(.+)$/,ag=/^(light|shadow)box\[(.*?)\]/i,aA=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,g=/[0-9a-z]+$/i,aF=/(.+\/)shadowbox\.js/i;var B=false,b=false,m={},A=0,T,aq;R.current=-1;R.dimensions=null;R.ease=function(K){return 1+Math.pow(K-1,3)};R.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};R.gallery=[];R.onReady=ak;R.path=null;R.player=null;R.playerId="sb-player";R.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:ak,onClose:ak,onFinish:ak,onOpen:ak,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};R.getCurrent=function(){return R.current>-1?R.gallery[R.current]:null};R.hasNext=function(){return R.gallery.length>1&&(R.current!=R.gallery.length-1||R.options.continuous)};R.isOpen=function(){return B};R.isPaused=function(){return aq=="pause"};R.applyOptions=function(K){m=aD({},R.options);aD(R.options,K)};R.revertOptions=function(){aD(R.options,m)};R.init=function(aH,aK){if(b){return}b=true;if(R.skin.options){aD(R.options,R.skin.options)}if(aH){aD(R.options,aH)}if(!R.path){var aJ,S=document.getElementsByTagName("script");for(var aI=0,K=S.length;aI<K;++aI){aJ=aF.exec(S[aI].src);if(aJ){R.path=aJ[1];break}}}if(aK){R.onReady=aK}Q()};R.open=function(S){if(B){return}var K=R.makeGallery(S);R.gallery=K[0];R.current=K[1];S=R.getCurrent();if(S==null){return}R.applyOptions(S.options||{});H();if(R.gallery.length){S=R.getCurrent();if(R.options.onOpen(S)===false){return}B=true;R.skin.onOpen(S,d)}};R.close=function(){if(!B){return}B=false;if(R.player){R.player.remove();R.player=null}if(typeof aq=="number"){clearTimeout(aq);aq=null}A=0;ar(false);R.options.onClose(R.getCurrent());R.skin.onClose();R.revertOptions()};R.play=function(){if(!R.hasNext()){return}if(!A){A=R.options.slideshowDelay*1000}if(A){T=ax();aq=setTimeout(function(){A=T=0;R.next()},A);if(R.skin.onPlay){R.skin.onPlay()}}};R.pause=function(){if(typeof aq!="number"){return}A=Math.max(0,A-(ax()-T));if(A){clearTimeout(aq);aq="pause";if(R.skin.onPause){R.skin.onPause()}}};R.change=function(K){if(!(K in R.gallery)){if(R.options.continuous){K=(K<0?R.gallery.length+K:0);if(!(K in R.gallery)){return}}else{return}}R.current=K;if(typeof aq=="number"){clearTimeout(aq);aq=null;A=T=0}R.options.onChange(R.getCurrent());d(true)};R.next=function(){R.change(R.current+1)};R.previous=function(){R.change(R.current-1)};R.setDimensions=function(aT,aK,aR,aS,aJ,K,aP,aM){var aO=aT,aI=aK;var aN=2*aP+aJ;if(aT+aN>aR){aT=aR-aN}var aH=2*aP+K;if(aK+aH>aS){aK=aS-aH}var S=(aO-aT)/aO,aQ=(aI-aK)/aI,aL=(S>0||aQ>0);if(aM&&aL){if(S>aQ){aK=Math.round((aI/aO)*aT)}else{if(aQ>S){aT=Math.round((aO/aI)*aK)}}}R.dimensions={height:aT+aJ,width:aK+K,innerHeight:aT,innerWidth:aK,top:Math.floor((aR-(aT+aN))/2+aP),left:Math.floor((aS-(aK+aH))/2+aP),oversized:aL};return R.dimensions};R.makeGallery=function(aJ){var K=[],aI=-1;if(typeof aJ=="string"){aJ=[aJ]}if(typeof aJ.length=="number"){aG(aJ,function(aL,aM){if(aM.content){K[aL]=aM}else{K[aL]={content:aM}}});aI=0}else{if(aJ.tagName){var S=R.getCache(aJ);aJ=S?S:R.makeObject(aJ)}if(aJ.gallery){K=[];var aK;for(var aH in R.cache){aK=R.cache[aH];if(aK.gallery&&aK.gallery==aJ.gallery){if(aI==-1&&aK.content==aJ.content){aI=K.length}K.push(aK)}}if(aI==-1){K.unshift(aJ);aI=0}}else{K=[aJ];aI=0}}aG(K,function(aL,aM){K[aL]=aD({},aM)});return[K,aI]};R.makeObject=function(aI,aH){var aJ={content:aI.href,title:aI.getAttribute("title")||"",link:aI};if(aH){aH=aD({},aH);aG(["player","title","height","width","gallery"],function(aK,aL){if(typeof aH[aL]!="undefined"){aJ[aL]=aH[aL];delete aH[aL]}});aJ.options=aH}else{aJ.options={}}if(!aJ.player){aJ.player=R.getPlayer(aJ.content)}var K=aI.getAttribute("rel");if(K){var S=K.match(ag);if(S){aJ.gallery=escape(S[2])}aG(K.split(";"),function(aK,aL){S=aL.match(aA);if(S){aJ[S[1]]=S[2]}})}return aJ};R.getPlayer=function(aH){if(aH.indexOf("#")>-1&&aH.indexOf(document.location.href)==0){return"inline"}var aI=aH.indexOf("?");if(aI>-1){aH=aH.substring(0,aI)}var S,K=aH.match(g);if(K){S=K[0].toLowerCase()}if(S){if(R.img&&R.img.ext.indexOf(S)>-1){return"img"}if(R.swf&&R.swf.ext.indexOf(S)>-1){return"swf"}if(R.flv&&R.flv.ext.indexOf(S)>-1){return"flv"}if(R.qt&&R.qt.ext.indexOf(S)>-1){if(R.wmp&&R.wmp.ext.indexOf(S)>-1){return"qtwmp"}else{return"qt"}}if(R.wmp&&R.wmp.ext.indexOf(S)>-1){return"wmp"}}return"iframe"};function H(){var aI=R.errorInfo,aJ=R.plugins,aL,aM,aP,aH,aO,S,aN,K;for(var aK=0;aK<R.gallery.length;++aK){aL=R.gallery[aK];aM=false;aP=null;switch(aL.player){case"flv":case"swf":if(!aJ.fla){aP="fla"}break;case"qt":if(!aJ.qt){aP="qt"}break;case"wmp":if(R.isMac){if(aJ.qt&&aJ.f4m){aL.player="qt"}else{aP="qtf4m"}}else{if(!aJ.wmp){aP="wmp"}}break;case"qtwmp":if(aJ.qt){aL.player="qt"}else{if(aJ.wmp){aL.player="wmp"}else{aP="qtwmp"}}break}if(aP){if(R.options.handleUnsupported=="link"){switch(aP){case"qtf4m":aO="shared";S=[aI.qt.url,aI.qt.name,aI.f4m.url,aI.f4m.name];break;case"qtwmp":aO="either";S=[aI.qt.url,aI.qt.name,aI.wmp.url,aI.wmp.name];break;default:aO="single";S=[aI[aP].url,aI[aP].name]}aL.player="html";aL.content='<div class="sb-message">'+t(R.lang.errors[aO],S)+"</div>"}else{aM=true}}else{if(aL.player=="inline"){aH=ac.exec(aL.content);if(aH){aN=ae(aH[1]);if(aN){aL.content=aN.innerHTML}else{aM=true}}else{aM=true}}else{if(aL.player=="swf"||aL.player=="flv"){K=(aL.options&&aL.options.flashVersion)||R.options.flashVersion;if(R.flash&&!R.flash.hasFlashPlayerVersion(K)){aL.width=310;aL.height=177}}}}if(aM){R.gallery.splice(aK,1);if(aK<R.current){--R.current}else{if(aK==R.current){R.current=aK>0?aK-1:aK}}--aK}}}function ar(K){if(!R.options.enableKeys){return}(K?G:N)(document,"keydown",ao)}function ao(aH){if(aH.metaKey||aH.shiftKey||aH.altKey||aH.ctrlKey){return}var S=w(aH),K;switch(S){case 81:case 88:case 27:K=R.close;break;case 37:K=R.previous;break;case 39:K=R.next;break;case 32:K=typeof aq=="number"?R.pause:R.play;break}if(K){o(aH);K()}}function d(aL){ar(false);var aK=R.getCurrent();var aH=(aK.player=="inline"?"html":aK.player);if(typeof R[aH]!="function"){throw"unknown player "+aH}if(aL){R.player.remove();R.revertOptions();R.applyOptions(aK.options||{})}R.player=new R[aH](aK,R.playerId);if(R.gallery.length>1){var aI=R.gallery[R.current+1]||R.gallery[0];if(aI.player=="img"){var S=new Image();S.src=aI.content}var aJ=R.gallery[R.current-1]||R.gallery[R.gallery.length-1];if(aJ.player=="img"){var K=new Image();K.src=aJ.content}}R.skin.onLoad(aL,X)}function X(){if(!B){return}if(typeof R.player.ready!="undefined"){var K=setInterval(function(){if(B){if(R.player.ready){clearInterval(K);K=null;R.skin.onReady(f)}}else{clearInterval(K);K=null}},10)}else{R.skin.onReady(f)}}function f(){if(!B){return}R.player.append(R.skin.body,R.dimensions);R.skin.onShow(J)}function J(){if(!B){return}if(R.player.onLoad){R.player.onLoad()}R.options.onFinish(R.getCurrent());if(!R.isPaused()){R.play()}ar(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(S,aH){var K=this.length>>>0;aH=aH||0;if(aH<0){aH+=K}for(;aH<K;++aH){if(aH in this&&this[aH]===S){return aH}}return -1}}function ax(){return(new Date).getTime()}function aD(K,aH){for(var S in aH){K[S]=aH[S]}return K}function aG(aI,aJ){var S=0,K=aI.length;for(var aH=aI[0];S<K&&aJ.call(aH,S,aH)!==false;aH=aI[++S]){}}function t(S,K){return S.replace(/\{(\w+?)\}/g,function(aH,aI){return K[aI]})}function ak(){}function ae(K){return document.getElementById(K)}function D(K){K.parentNode.removeChild(K)}var i=true,y=true;function e(){var K=document.body,S=document.createElement("div");i=typeof S.style.opacity==="string";S.style.position="fixed";S.style.margin=0;S.style.top="20px";K.appendChild(S,K.firstChild);y=S.offsetTop==20;K.removeChild(S)}R.getStyle=(function(){var K=/opacity=([^)]*)/,S=document.defaultView&&document.defaultView.getComputedStyle;return function(aK,aJ){var aI;if(!i&&aJ=="opacity"&&aK.currentStyle){aI=K.test(aK.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return aI===""?"1":aI}if(S){var aH=S(aK,null);if(aH){aI=aH[aJ]}if(aJ=="opacity"&&aI==""){aI="1"}}else{aI=aK.currentStyle[aJ]}return aI}})();R.appendHTML=function(aH,S){if(aH.insertAdjacentHTML){aH.insertAdjacentHTML("BeforeEnd",S)}else{if(aH.lastChild){var K=aH.ownerDocument.createRange();K.setStartAfter(aH.lastChild);var aI=K.createContextualFragment(S);aH.appendChild(aI)}else{aH.innerHTML=S}}};R.getWindowSize=function(K){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+K]}return document.body["client"+K]};R.setOpacity=function(aH,K){var S=aH.style;if(i){S.opacity=(K==1?"":K)}else{S.zoom=1;if(K==1){if(typeof S.filter=="string"&&(/alpha/i).test(S.filter)){S.filter=S.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{S.filter=(S.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(K*100)+")"}}};R.clearOpacity=function(K){R.setOpacity(K,1)};function p(S){var K=S.target?S.target:S.srcElement;return K.nodeType==3?K.parentNode:K}function W(S){var K=S.pageX||(S.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),aH=S.pageY||(S.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[K,aH]}function o(K){K.preventDefault()}function w(K){return K.which?K.which:K.keyCode}function G(aI,aH,S){if(aI.addEventListener){aI.addEventListener(aH,S,false)}else{if(aI.nodeType===3||aI.nodeType===8){return}if(aI.setInterval&&(aI!==av&&!aI.frameElement)){aI=av}if(!S.__guid){S.__guid=G.guid++}if(!aI.events){aI.events={}}var K=aI.events[aH];if(!K){K=aI.events[aH]={};if(aI["on"+aH]){K[0]=aI["on"+aH]}}K[S.__guid]=S;aI["on"+aH]=G.handleEvent}}G.guid=1;G.handleEvent=function(aI){var K=true;aI=aI||G.fixEvent(((this.ownerDocument||this.document||this).parentWindow||av).event);var S=this.events[aI.type];for(var aH in S){this.__handleEvent=S[aH];if(this.__handleEvent(aI)===false){K=false}}return K};G.preventDefault=function(){this.returnValue=false};G.stopPropagation=function(){this.cancelBubble=true};G.fixEvent=function(K){K.preventDefault=G.preventDefault;K.stopPropagation=G.stopPropagation;return K};function N(aH,S,K){if(aH.removeEventListener){aH.removeEventListener(S,K,false)}else{if(aH.events&&aH.events[S]){delete aH.events[S][K.__guid]}}}var z=false,am;if(document.addEventListener){am=function(){document.removeEventListener("DOMContentLoaded",am,false);R.load()}}else{if(document.attachEvent){am=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",am);R.load()}}}}function h(){if(z){return}try{document.documentElement.doScroll("left")}catch(K){setTimeout(h,1);return}R.load()}function Q(){if(document.readyState==="complete"){return R.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",am,false);av.addEventListener("load",R.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",am);av.attachEvent("onload",R.load);var K=false;try{K=av.frameElement===null}catch(S){}if(document.documentElement.doScroll&&K){h()}}}}R.load=function(){if(z){return}if(!document.body){return setTimeout(R.load,13)}z=true;e();R.onReady();if(!R.options.skipSetup){R.setup()}R.skin.init()};R.plugins={};if(navigator.plugins&&navigator.plugins.length){var x=[];aG(navigator.plugins,function(K,S){x.push(S.name)});x=x.join(",");var aj=x.indexOf("Flip4Mac")>-1;R.plugins={fla:x.indexOf("Shockwave Flash")>-1,qt:x.indexOf("QuickTime")>-1,wmp:!aj&&x.indexOf("Windows Media")>-1,f4m:aj}}else{var q=function(K){var S;try{S=new ActiveXObject(K)}catch(aH){}return !!S};R.plugins={fla:q("ShockwaveFlash.ShockwaveFlash"),qt:q("QuickTime.QuickTime"),wmp:q("wmplayer.ocx"),f4m:false}}var Y=/^(light|shadow)box/i,an="shadowboxCacheKey",c=1;R.cache={};R.select=function(S){var aH=[];if(!S){var K;aG(document.getElementsByTagName("a"),function(aK,aL){K=aL.getAttribute("rel");if(K&&Y.test(K)){aH.push(aL)}})}else{var aJ=S.length;if(aJ){if(typeof S=="string"){if(R.find){aH=R.find(S)}}else{if(aJ==2&&typeof S[0]=="string"&&S[1].nodeType){if(R.find){aH=R.find(S[0],S[1])}}else{for(var aI=0;aI<aJ;++aI){aH[aI]=S[aI]}}}}else{aH.push(S)}}return aH};R.setup=function(K,S){aG(R.select(K),function(aH,aI){R.addCache(aI,S)})};R.teardown=function(K){aG(R.select(K),function(S,aH){R.removeCache(aH)})};R.addCache=function(aH,K){var S=aH[an];if(S==l){S=c++;aH[an]=S;G(aH,"click",v)}R.cache[S]=R.makeObject(aH,K)};R.removeCache=function(K){N(K,"click",v);delete R.cache[K[an]];K[an]=null};R.getCache=function(S){var K=S[an];return(K in R.cache&&R.cache[K])};R.clearCache=function(){for(var K in R.cache){R.removeCache(R.cache[K].link)}R.cache={}};function v(K){R.open(this);if(R.gallery.length){o(K)}}R.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};var E,au="sb-drag-proxy",F,k,ah;function ay(){F={x:0,y:0,startX:null,startY:null}}function aB(){var K=R.dimensions;aD(k.style,{height:K.innerHeight+"px",width:K.innerWidth+"px"})}function P(){ay();var K=["position:absolute","cursor:"+(R.isGecko?"-moz-grab":"move"),"background-color:"+(R.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");R.appendHTML(R.skin.body,'<div id="'+au+'" style="'+K+'"></div>');k=ae(au);aB();G(k,"mousedown",M)}function C(){if(k){N(k,"mousedown",M);D(k);k=null}ah=null}function M(S){o(S);var K=W(S);F.startX=K[0];F.startY=K[1];ah=ae(R.player.id);G(document,"mousemove",I);G(document,"mouseup",j);if(R.isGecko){k.style.cursor="-moz-grabbing"}}function I(aJ){var K=R.player,aK=R.dimensions,aI=W(aJ);var aH=aI[0]-F.startX;F.startX+=aH;F.x=Math.max(Math.min(0,F.x+aH),aK.innerWidth-K.width);var S=aI[1]-F.startY;F.startY+=S;F.y=Math.max(Math.min(0,F.y+S),aK.innerHeight-K.height);aD(ah.style,{left:F.x+"px",top:F.y+"px"})}function j(){N(document,"mousemove",I);N(document,"mouseup",j);if(R.isGecko){k.style.cursor="-moz-grab"}}R.img=function(S,aH){this.obj=S;this.id=aH;this.ready=false;var K=this;E=new Image();E.onload=function(){K.height=S.height?parseInt(S.height,10):E.height;K.width=S.width?parseInt(S.width,10):E.width;K.ready=true;E.onload=null;E=null};E.src=S.content};R.img.ext=["bmp","gif","jpg","jpeg","png"];R.img.prototype={append:function(S,aJ){var aH=document.createElement("img");aH.id=this.id;aH.src=this.obj.content;aH.style.position="absolute";var K,aI;if(aJ.oversized&&R.options.handleOversize=="resize"){K=aJ.innerHeight;aI=aJ.innerWidth}else{K=this.height;aI=this.width}aH.setAttribute("height",K);aH.setAttribute("width",aI);S.appendChild(aH)},remove:function(){var K=ae(this.id);if(K){D(K)}C();if(E){E.onload=null;E=null}},onLoad:function(){var K=R.dimensions;if(K.oversized&&R.options.handleOversize=="drag"){P()}},onWindowResize:function(){var aI=R.dimensions;switch(R.options.handleOversize){case"resize":var K=ae(this.id);K.height=aI.innerHeight;K.width=aI.innerWidth;break;case"drag":if(ah){var aH=parseInt(R.getStyle(ah,"top")),S=parseInt(R.getStyle(ah,"left"));if(aH+this.height<aI.innerHeight){ah.style.top=aI.innerHeight-this.height+"px"}if(S+this.width<aI.innerWidth){ah.style.left=aI.innerWidth-this.width+"px"}aB()}break}}};var a=16;R.qt=function(K,S){this.obj=K;this.id=S;this.height=K.height?parseInt(K.height,10):300;if(R.options.showMovieControls){this.height+=a}this.width=K.width?parseInt(K.width,10):300};R.qt.ext=["dv","mov","moov","movie","mp4","avi","mpg","mpeg"];R.qt.prototype={append:function(aM,aN){var S=R.options,aH=String(S.autoplayMovies),aO=String(S.showMovieControls);var aL="<object",aJ={id:this.id,name:this.id,height:this.height,width:this.width,kioskmode:"true"};if(R.isIE){aJ.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";aJ.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"}else{aJ.type="video/quicktime";aJ.data=this.obj.content}for(var aI in aJ){aL+=" "+aI+'="'+aJ[aI]+'"'}aL+=">";var aK={src:this.obj.content,scale:"aspect",controller:aO,autoplay:aH};for(var K in aK){aL+='<param name="'+K+'" value="'+aK[K]+'">'}aL+="</object>";aM.innerHTML=aL},remove:function(){try{document[this.id].Stop()}catch(S){}var K=ae(this.id);if(K){D(K)}}};var ap=false,Z=[],r=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],ab,af,aa,n=true;function O(aH,aR,aO,aM,aS){var K=(aR=="opacity"),aN=K?R.setOpacity:function(aT,aU){aT.style[aR]=""+aU+"px"};if(aM==0||(!K&&!R.options.animate)||(K&&!R.options.animateFade)){aN(aH,aO);if(aS){aS()}return}var aP=parseFloat(R.getStyle(aH,aR))||0;var aQ=aO-aP;if(aQ==0){if(aS){aS()}return}aM*=1000;var aI=ax(),aL=R.ease,aK=aI+aM,aJ;var S=setInterval(function(){aJ=ax();if(aJ>=aK){clearInterval(S);S=null;aN(aH,aO);if(aS){aS()}}else{aN(aH,aP+aL((aJ-aI)/aM)*aQ)}},10)}function aC(){ab.style.height=R.getWindowSize("Height")+"px";ab.style.width=R.getWindowSize("Width")+"px"}function aE(){ab.style.top=document.documentElement.scrollTop+"px";ab.style.left=document.documentElement.scrollLeft+"px"}function az(K){if(K){aG(Z,function(S,aH){aH[0].style.visibility=aH[1]||""})}else{Z=[];aG(R.options.troubleElements,function(aH,S){aG(document.getElementsByTagName(S),function(aI,aJ){Z.push([aJ,aJ.style.visibility]);aJ.style.visibility="hidden"})})}}function s(aH,K){var S=ae("sb-nav-"+aH);if(S){S.style.display=K?"":"none"}}function ai(K,aK){var aJ=ae("sb-loading"),aH=R.getCurrent().player,aI=(aH=="img"||aH=="html");if(K){R.setOpacity(aJ,0);aJ.style.display="block";var S=function(){R.clearOpacity(aJ);if(aK){aK()}};if(aI){O(aJ,"opacity",1,R.options.fadeDuration,S)}else{S()}}else{var S=function(){aJ.style.display="none";R.clearOpacity(aJ);if(aK){aK()}};if(aI){O(aJ,"opacity",0,R.options.fadeDuration,S)}else{S()}}}function u(aP){var aK=R.getCurrent();ae("sb-title-inner").innerHTML=aK.title||"";var aQ,aM,S,aR,aN;if(R.options.displayNav){aQ=true;var aO=R.gallery.length;if(aO>1){if(R.options.continuous){aM=aN=true}else{aM=(aO-1)>R.current;aN=R.current>0}}if(R.options.slideshowDelay>0&&R.hasNext()){aR=!R.isPaused();S=!aR}}else{aQ=aM=S=aR=aN=false}s("close",aQ);s("next",aM);s("play",S);s("pause",aR);s("previous",aN);var K="";if(R.options.displayCounter&&R.gallery.length>1){var aO=R.gallery.length;if(R.options.counterType=="skip"){var aJ=0,aI=aO,aH=parseInt(R.options.counterLimit)||0;if(aH<aO&&aH>2){var aL=Math.floor(aH/2);aJ=R.current-aL;if(aJ<0){aJ+=aO}aI=R.current+(aH-aL);if(aI>aO){aI-=aO}}while(aJ!=aI){if(aJ==aO){aJ=0}K+='<a onclick="Shadowbox.change('+aJ+');"';if(aJ==R.current){K+=' class="sb-counter-current"'}K+=">"+(++aJ)+"</a>"}}else{K=[R.current+1,R.lang.of,aO].join(" ")}}ae("sb-counter").innerHTML=K;aP()}function V(aI){var K=ae("sb-title-inner"),aH=ae("sb-info-inner"),S=0.35;K.style.visibility=aH.style.visibility="";if(K.innerHTML!=""){O(K,"marginTop",0,S)}O(aH,"marginTop",0,S,aI)}function aw(aH,aN){var aL=ae("sb-title"),K=ae("sb-info"),aI=aL.offsetHeight,aJ=K.offsetHeight,aK=ae("sb-title-inner"),aM=ae("sb-info-inner"),S=(aH?0.35:0);O(aK,"marginTop",aI,S);O(aM,"marginTop",aJ*-1,S,function(){aK.style.visibility=aM.style.visibility="hidden";aN()})}function ad(K,aI,S,aK){var aJ=ae("sb-wrapper-inner"),aH=(S?R.options.resizeDuration:0);O(aa,"top",aI,aH);O(aJ,"height",K,aH,aK)}function at(K,aI,S,aJ){var aH=(S?R.options.resizeDuration:0);O(aa,"left",aI,aH);O(aa,"width",K,aH,aJ)}function al(aN,aH){var aJ=ae("sb-body-inner"),aN=parseInt(aN),aH=parseInt(aH),S=aa.offsetHeight-aJ.offsetHeight,K=aa.offsetWidth-aJ.offsetWidth,aL=af.offsetHeight,aM=af.offsetWidth,aK=parseInt(R.options.viewportPadding)||20,aI=(R.player&&R.options.handleOversize!="drag");return R.setDimensions(aN,aH,aL,aM,S,K,aK,aI)}var U={};U.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';U.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};U.init=function(){R.appendHTML(document.body,t(U.markup,R.lang));U.body=ae("sb-body-inner");ab=ae("sb-container");af=ae("sb-overlay");aa=ae("sb-wrapper");if(!y){ab.style.position="absolute"}if(!i){var aH,K,S=/url\("(.*\.png)"\)/;aG(r,function(aJ,aK){aH=ae(aK);if(aH){K=R.getStyle(aH,"backgroundImage").match(S);if(K){aH.style.backgroundImage="none";aH.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+K[1]+",sizingMethod=scale);"}}})}var aI;G(av,"resize",function(){if(aI){clearTimeout(aI);aI=null}if(B){aI=setTimeout(U.onWindowResize,10)}})};U.onOpen=function(K,aH){n=false;ab.style.display="block";aC();var S=al(R.options.initialHeight,R.options.initialWidth);ad(S.innerHeight,S.top);at(S.width,S.left);if(R.options.showOverlay){af.style.backgroundColor=R.options.overlayColor;R.setOpacity(af,0);if(!R.options.modal){G(af,"click",R.close)}ap=true}if(!y){aE();G(av,"scroll",aE)}az();ab.style.visibility="visible";if(ap){O(af,"opacity",R.options.overlayOpacity,R.options.fadeDuration,aH)}else{aH()}};U.onLoad=function(S,K){ai(true);while(U.body.firstChild){D(U.body.firstChild)}aw(S,function(){if(!B){return}if(!S){aa.style.visibility="visible"}u(K)})};U.onReady=function(aI){if(!B){return}var S=R.player,aH=al(S.height,S.width);var K=function(){V(aI)};switch(R.options.animSequence){case"hw":ad(aH.innerHeight,aH.top,true,function(){at(aH.width,aH.left,true,K)});break;case"wh":at(aH.width,aH.left,true,function(){ad(aH.innerHeight,aH.top,true,K)});break;default:at(aH.width,aH.left,true);ad(aH.innerHeight,aH.top,true,K)}};U.onShow=function(K){ai(false,K);n=true};U.onClose=function(){if(!y){N(av,"scroll",aE)}N(af,"click",R.close);aa.style.visibility="hidden";var K=function(){ab.style.visibility="hidden";ab.style.display="none";az(true)};if(ap){O(af,"opacity",0,R.options.fadeDuration,K)}else{K()}};U.onPlay=function(){s("play",false);s("pause",true)};U.onPause=function(){s("pause",false);s("play",true)};U.onWindowResize=function(){if(!n){return}aC();var K=R.player,S=al(K.height,K.width);at(S.width,S.left);ad(S.innerHeight,S.top);if(K.onWindowResize){K.onWindowResize()}};R.skin=U;av.Shadowbox=R})(window);
