if(typeof Shadowbox=="undefined")throw"Unable to load Shadowbox, no base library adapter found";(function(){var Q='.js"></sc',P="shadowbox-",O="ript>",j='<script type="text/javascript" src="',N="click",M="shadowbox_overlay",L="shadowbox_container",c="number",f="width",K="shadowbox",h="top",J="shadowbox_body",I="undefined",m="margin-top",l="shadowbox_info_inner",H="shadowbox_info",G="shadowbox_title",F="pause",E="play",D="paused",C="shadowbox_title_inner",i="none",B="unsupported",A="img",z="inline",y="border-bottom-width",x="border-top-width",g="height",t="px",s="",r="opacity",p="function",e="string",k=-1,o="html",b="Flip4Mac",a="QuickTime",n=null,w="resize",v=10,u=false,q=true,version="2.0rc1",options={animate:q,animateFade:q,animSequence:"wh",flvPlayer:"flvplayer.swf",modal:u,flashBgColor:"#000000",autoplayMovies:q,showMovieControls:q,slideshowDelay:0,resizeDuration:.55,displayNav:q,continuous:u,displayCounter:q,counterType:"default",counterLimit:v,viewportPadding:20,handleOversize:w,handleException:n,handleUnsupported:"link",initialHeight:160,initialWidth:320,enableKeys:q,onOpen:n,onFinish:n,onChange:n,onClose:n,skipSetup:u,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:a,url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:b,url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"],iframe:["asp","aspx","cgi","cfm","htm",o,"pl","php","php3","php4","php5","phtml","rb","rhtml","shtml","txt","vbs"]}},SB=Shadowbox,SL=SB.lib,default_options,RE={domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/,empty:/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i},cache=[],gallery,current,content,content_id="shadowbox_content",dims,initialized=u,activated=u,slide_timer,slide_start,slide_delay=0,ua=navigator.userAgent.toLowerCase(),client={isStrict:document.compatMode=="CSS1Compat",isOpera:ua.indexOf("opera")>k,isIE:ua.indexOf("msie")>k,isIE7:ua.indexOf("msie 7")>k,isSafari:/webkit|khtml/.test(ua),isWindows:ua.indexOf("windows")!=k||ua.indexOf("win32")!=k,isMac:ua.indexOf("macintosh")!=k||ua.indexOf("mac os x")!=k,isLinux:ua.indexOf("linux")!=k};client.isBorderBox=client.isIE&&!client.isStrict;client.isSafari3=client.isSafari&&!!document.evaluate;client.isGecko=ua.indexOf("gecko")!=k&&!client.isSafari;var ltIE7=client.isIE&&!client.isIE7,plugins;if(navigator.plugins&&navigator.plugins.length){var detectPlugin=function(c){for(var b=u,a=0,d=navigator.plugins.length;a<d;++a)if(navigator.plugins[a].name.indexOf(c)>k){b=q;break}return b},f4m=detectPlugin(b);plugins={fla:detectPlugin("Shockwave Flash"),qt:detectPlugin(a),wmp:!f4m&&detectPlugin("Windows Media"),f4m:f4m}}else{var detectPlugin=function(b){var a=u;try{var c=new ActiveXObject(b);if(c)a=q}catch(d){}return a};plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:u}}var apply=function(b,a){for(var c in a)b[c]=a[c];return b},isLink=function(a){return a&&typeof a.tagName==e&&(a.tagName.toUpperCase()=="A"||a.tagName.toUpperCase()=="AREA")};SL.getViewportHeight=function(){var a=window.innerHeight,b=document.compatMode;if((b||client.isIE)&&!client.isOpera)a=client.isStrict?document.documentElement.clientHeight:document.body.clientHeight;return a};SL.getViewportWidth=function(){var a=window.innerWidth,b=document.compatMode;if(b||client.isIE)a=client.isStrict?document.documentElement.clientWidth:document.body.clientWidth;return a};SL.createHTML=function(a){var b="<"+a.tag;for(var c in a){if(c=="tag"||c==o||c=="children")continue;if(c=="cls")b+=' class="'+a.cls+'"';else b+=" "+c+'="'+a[c]+'"'}if(RE.empty.test(a.tag))b+="/>\n";else{b+=">\n";var d=a.children;if(d)for(var e=0,f=d.length;e<f;++e)b+=this.createHTML(d[e]);if(a.html)b+=a.html;b+="</"+a.tag+">\n"}return b};var ease=function(a){return 1+Math.pow(a-1,3)},animate=function(h,f,i,e,a){var b=parseFloat(SL.getStyle(h,f));if(isNaN(b))b=0;if(b==i){typeof a==p&&a();return}var j=i-b,d=f==r,l=d?s:t,c=function(a){SL.setStyle(h,f,b+a*j+l)};if(!options.animate&&!d||d&&!options.animateFade){c(1);typeof a==p&&a();return}e*=1e3;var g=(new Date).getTime(),m=g+e,k=setInterval(function(){var b=(new Date).getTime();if(b>=m){clearInterval(k);c(1);typeof a==p&&a()}else c(ease((b-g)/e))},v)},clearOpacity=function(b){var a=b.style;if(client.isIE){if(typeof a.filter==e&&/alpha/i.test(a.filter))a.filter=a.filter.replace(/[\w\.]*alpha\(.*?\);?/i,s)}else{a.opacity=s;a["-moz-opacity"]=s;a["-khtml-opacity"]=s}},getComputedHeight=function(a){var b=Math.max(a.offsetHeight,a.clientHeight);if(!b){b=parseInt(SL.getStyle(a,g),v)||0;if(!client.isBorderBox)b+=parseInt(SL.getStyle(a,"padding-top"),v)+parseInt(SL.getStyle(a,"padding-bottom"),v)+parseInt(SL.getStyle(a,x),v)+parseInt(SL.getStyle(a,y),v)}return b},getPlayer=function(a){var b="unsupported-qt",d=a.match(RE.domain),c=d&&document.domain==d[1];if(a.indexOf("#")>k&&c)return z;var e=a.indexOf("?");if(e>k)a=a.substring(0,e);if(RE.img.test(a))return A;if(RE.swf.test(a))return plugins.fla?"swf":"unsupported-swf";if(RE.flv.test(a))return plugins.fla?"flv":"unsupported-flv";if(RE.qt.test(a))return plugins.qt?"qt":b;if(RE.wmp.test(a)){if(plugins.wmp)return "wmp";if(plugins.f4m)return "qt";if(client.isMac)return plugins.qt?"unsupported-f4m":"unsupported-qtf4m";return "unsupported-wmp"}else if(RE.qtwmp.test(a)){if(plugins.qt)return "qt";if(plugins.wmp)return "wmp";return client.isMac?b:"unsupported-qtwmp"}else if(!c||RE.iframe.test(a))return "iframe";return B},handleClick=function(b){var a;if(isLink(this))a=this;else{a=SL.getTarget(b);while(!isLink(a)&&a.parentNode)a=a.parentNode}if(a){SB.open(a);gallery.length&&SL.preventDefault(b)}},toggleNav=function(b,c){var a=SL.get("shadowbox_nav_"+b);if(a)a.style.display=c?s:i},buildBars=function(p){var o=gallery[current],m=SL.get(C);m.innerHTML=o.title||s;var n=SL.get("shadowbox_nav");if(n){var j,f,i,e,g;if(options.displayNav){j=q;var a=gallery.length;if(a>1)if(options.continuous)f=g=q;else{f=a-1>current;g=current>0}if(options.slideshowDelay>0&&hasNext()){e=slide_timer!=D;i=!e}}else j=f=i=e=g=u;toggleNav("close",j);toggleNav("next",f);toggleNav(E,i);toggleNav(F,e);toggleNav("previous",g)}var k=SL.get("shadowbox_counter");if(k){var c=s;if(options.displayCounter&&gallery.length>1)if(options.counterType=="skip"){var b=0,a=gallery.length,d=a,h=parseInt(options.counterLimit);if(h<a){var l=Math.round(h/2);b=current-l;if(b<0)b+=a;d=current+(h-l);if(d>a)d-=a}while(b!=d){if(b==a)b=0;c+='<a onclick="Shadowbox.change('+b+');"';if(b==current)c+=' class="shadowbox_counter_current"';c+=">"+ ++b+"</a>"}}else c=current+1+" "+SB.LANG.of+" "+a;k.innerHTML=c}p()},hideBars=function(g,i){var j=gallery[current],f=SL.get(G),h=SL.get(H),b=SL.get(C),d=SL.get(l),e=function(){buildBars(i)},a=getComputedHeight(f),c=getComputedHeight(h)*k;if(g){animate(b,m,a,.35);animate(d,m,c,.35,e)}else{SL.setStyle(b,m,a+t);SL.setStyle(d,m,c+t);e()}},showBars=function(c){var a=SL.get(C),b=SL.get(l),d=a.innerHTML!=s;d&&animate(a,m,0,.35);animate(b,m,0,.35,c)},loadContent=function(){var a=gallery[current];if(!a)return;var b=u;if(content){content.remove();b=q}var e=a.player==z?o:a.player;typeof SB[e]!=p&&SB.raise("Unknown player "+a.player);content=new SB[e](content_id,a);listenKeys(u);toggleLoading(q);hideBars(b,function(){if(!content)return;var b=function(){resizeContent(function(){if(!content)return;showBars(function(){if(!content)return;SL.get("shadowbox_body_inner").innerHTML=SL.createHTML(content.markup(dims));toggleLoading(u,function(){if(!content)return;typeof content.onLoad==p&&content.onLoad();options.onFinish&&typeof options.onFinish==p&&options.onFinish(gallery[current]);slide_timer!=D&&SB.play();listenKeys(q)})})})};if(typeof content.ready!=I)var a=setInterval(function(){if(content){if(content.ready){clearInterval(a);a=n;b()}}else{clearInterval(a);a=n}},100);else b()});if(gallery.length>1){var c=gallery[current+1]||gallery[0];if(c.player==A){var f=new Image;f.src=c.content}var d=gallery[current-1]||gallery[gallery.length-1];if(d.player==A){var g=new Image;g.src=d.content}}},setDimensions=function(c,d,f){f=f||u;var e=SL.get(J),a=c=parseInt(c),b=d=parseInt(d),k=SL.getViewportHeight(),q=SL.getViewportWidth(),m=parseInt(SL.getStyle(e,"border-left-width"),v)+parseInt(SL.getStyle(e,"border-right-width"),v),p=m+2*options.viewportPadding;if(b+p>=q)b=q-p;var l=parseInt(SL.getStyle(e,x),v)+parseInt(SL.getStyle(e,y),v),r=getComputedHeight(SL.get(G))+getComputedHeight(SL.get(H)),i=l+2*options.viewportPadding+r;if(a+i>=k)a=k-i;var s=u,n=c,o=d,j=options.handleOversize;if(f&&(j==w||j=="drag")){var g=(c-a)/c,h=(d-b)/d;if(j==w){if(g>h)b=Math.round(d/c*a);else if(h>g)a=Math.round(c/d*b);o=b;n=a}else{var t=gallery[current];if(t)s=t.player==A&&(g>0||h>0)}}dims={height:a+l+r,width:b+m,inner_h:a,inner_w:b,top:(k-(a+i))/2+options.viewportPadding,resize_h:n,resize_w:o,drag:s}},resizeContent=function(b){if(!content)return;setDimensions(content.height,content.width,content.resizable);if(b)switch(options.animSequence){case "hw":adjustHeight(dims.inner_h,dims.top,q,function(){adjustWidth(dims.width,q,b)});break;case "wh":adjustWidth(dims.width,q,function(){adjustHeight(dims.inner_h,dims.top,q,b)});break;case "sync":default:adjustWidth(dims.width,q);adjustHeight(dims.inner_h,dims.top,q,b)}else{adjustWidth(dims.width,u);adjustHeight(dims.inner_h,dims.top,u);var a=SL.get(content_id);if(a){if(content.resizable&&options.handleOversize==w){a.height=dims.resize_h;a.width=dims.resize_w}if(gallery[current].player==A&&options.handleOversize=="drag"){var d=parseInt(SL.getStyle(a,h));d+content.height<dims.inner_h&&SL.setStyle(a,h,dims.inner_h-content.height+t);var c=parseInt(SL.getStyle(a,"left"));c+content.width<dims.inner_w&&SL.setStyle(a,"left",dims.inner_w-content.width+t)}}}},adjustHeight=function(a,d,c,b){a=parseInt(a);var e=SL.get(J);if(c)animate(e,g,a,options.resizeDuration);else SL.setStyle(e,g,a+t);var f=SL.get(K);if(c)animate(f,h,d,options.resizeDuration,b);else{SL.setStyle(f,h,d+t);typeof b==p&&b()}},adjustWidth=function(a,d,b){a=parseInt(a);var c=SL.get(K);if(d)animate(c,f,a,options.resizeDuration,b);else{SL.setStyle(c,f,a+t);typeof b==p&&b()}},listenKeys=function(a){if(!options.enableKeys)return;SL[(a?"add":"remove")+"Event"](document,"keydown",handleKey)},handleKey=function(b){var a=SL.keyCode(b);SL.preventDefault(b);if(a==81||a==88||a==27)SB.close();else if(a==37)SB.previous();else if(a==39)SB.next();else a==32&&SB[typeof slide_timer==c?F:E]()},toggleLoading=function(f,b){var a=SL.get("shadowbox_loading");if(f){a.style.display=s;typeof b==p&&b()}else{var d=gallery[current].player,e=d==A||d==o,c=function(){a.style.display=i;clearOpacity(a);typeof b==p&&b()};if(e)animate(a,r,0,.35,c);else c()}},fixTop=function(){SL.get(L).style.top=document.documentElement.scrollTop+t},fixHeight=function(){SL.get(M).style.height=SL.getViewportHeight()+t},hasNext=function(){return gallery.length>1&&(current!=gallery.length-1||options.continuous)},toggleVisible=function(g){var a="hidden";for(var c,k=g?a:"visible",f=["select","object","embed"],d=0;d<f.length;++d){c=document.getElementsByTagName(f[d]);for(var e=0,j=c.length;e<j;++e)c[e].style.visibility=k}var b=SL.get(M),i=SL.get(L);if(g){!options.modal&&SL.addEvent(b,N,SB.close);if(ltIE7){fixTop();fixHeight();SL.addEvent(window,"scroll",fixTop)}i.style.visibility="visible"}else{SL.removeEvent(b,N,SB.close);ltIE7&&SL.removeEvent(window,"scroll",fixTop);var h=SL.get(K);h.style.visibility=a;animate(b,r,0,.2,function(){i.style.visibility=a;h.style.visibility=s;clearOpacity(b)})}};Shadowbox.init=function(h){if(initialized)return;if(typeof SB.LANG==I){SB.raise("No Shadowbox language loaded");return}if(typeof SB.SKIN==I){SB.raise("No Shadowbox skin loaded");return}apply(options,h||{});var g=SB.SKIN.markup.replace(/\{(\w+)\}/g,function(b,a){return SB.LANG[a]});SL.append(document.body,g);if(ltIE7){SL.setStyle(SL.get(L),"position","absolute");SL.get(J).style.zoom=1;var a=SB.SKIN.png_fix;if(a&&a.constructor==Array)for(var d=0;d<a.length;++d){var c=SL.get(a[d]);if(c){var e=SL.getStyle(c,"background-image").match(/url\("(.*\.png)"\)/);e&&SL.setStyle(c,{backgroundImage:i,filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+e[1]+",sizingMethod=scale);"})}}}for(var f in options.ext)RE[f]=new RegExp(".("+options.ext[f].join("|")+")s*$","i");var b;SL.addEvent(window,w,function(){if(b){clearTimeout(b);b=n}b=setTimeout(function(){ltIE7&&fixHeight();resizeContent()},50)});!options.skipSetup&&SB.setup();initialized=q};Shadowbox.loadSkin=function(a,b){if(!/\/$/.test(b))b+="/";a=b+a+"/";document.write('<link rel="stylesheet" type="text/css" href="'+a+'skin.css">');document.write(j+a+('skin.js"></sc'+O))};Shadowbox.loadLanguage=function(b,a){if(!/\/$/.test(a))a+="/";document.write(j+a+P+b+(Q+O))};Shadowbox.loadPlayer=function(a,b){if(typeof a==e)a=[a];if(!/\/$/.test(b))b+="/";for(var c=0,d=a.length;c<d;++c)document.write(j+b+P+a[c]+(Q+O))};Shadowbox.setup=function(a,g){if(!a)for(var a=[],e=document.getElementsByTagName("a"),d,b=0,f=e.length;b<f;++b){d=e[b].getAttribute("rel");if(d&&RE.rel.test(d))a[a.length]=e[b]}else if(!a.length)a=[a];for(var c,b=0,f=a.length;b<f;++b){c=a[b];if(typeof c.shadowboxCacheKey==I){c.shadowboxCacheKey=cache.length;SL.addEvent(c,N,handleClick)}cache[c.shadowboxCacheKey]=this.buildCacheObj(c,g)}};Shadowbox.buildCacheObj=function(link,opts){for(var href=link.href,o={el:link,title:link.getAttribute("title"),player:getPlayer(href),options:apply({},opts||{}),content:href},opt,l_opts=["player","title",g,f,"gallery"],i=0,len=l_opts.length;i<len;++i){opt=l_opts[i];if(typeof o.options[opt]!=I){o[opt]=o.options[opt];delete o.options[opt]}}var rel=link.getAttribute("rel");if(rel){var match=rel.match(RE.gallery);if(match)o.gallery=escape(match[2]);for(var params=rel.split(";"),i=0,len=params.length;i<len;++i){match=params[i].match(RE.param);if(match)if(match[1]=="options")eval("apply(o.options, "+match[2]+")");else o[match[1]]=match[2]}}return o};Shadowbox.applyOptions=function(a){if(a){default_options=apply({},options);options=apply(options,a)}};Shadowbox.revertOptions=function(){if(default_options){options=default_options;default_options=n}};Shadowbox.open=function(a,i){this.revertOptions();if(isLink(a))if(typeof a.shadowboxCacheKey==I||typeof cache[a.shadowboxCacheKey]==I)a=this.buildCacheObj(a,i);else a=cache[a.shadowboxCacheKey];if(a.constructor==Array){gallery=a;current=0}else{var j=apply({},a);if(!a.gallery){gallery=[j];current=0}else{current=n;gallery=[];for(var e,b=0,k=cache.length;b<k;++b){e=cache[b];if(e.gallery){if(e.content==a.content&&e.gallery==a.gallery&&e.title==a.title)current=gallery.length;e.gallery==a.gallery&&gallery.push(apply({},e))}}if(current==n){gallery.unshift(j);current=0}}}a=gallery[current];(a.options||i)&&this.applyOptions(apply(apply({},a.options||{}),i||{}));for(var c,g,b=0,k=gallery.length;b<k;++b){g=u;if(gallery[b].player==B)g=q;else if(c=RE.unsupported.exec(gallery[b].player))if(options.handleUnsupported=="link"){gallery[b].player=o;var h,f,d=options.errors;switch(c[1]){case "qtwmp":h="either";f=[d.qt.url,d.qt.name,d.wmp.url,d.wmp.name];break;case "qtf4m":h="shared";f=[d.qt.url,d.qt.name,d.f4m.url,d.f4m.name];break;default:h="single";if(c[1]=="swf"||c[1]=="flv")c[1]="fla";f=[d[c[1]].url,d[c[1]].name]}var m=SB.LANG.errors[h].replace(/\{(\d+)\}/g,function(b,a){return f[a]});gallery[b].content='<div class="shadowbox_message">'+m+"</div>"}else g=q;else if(gallery[b].player==z){var c=RE.inline.exec(gallery[b].content);if(c){var l;if(l=SL.get(c[1]))gallery[b].content=l.innerHTML;else SB.raise("Cannot find element with id "+c[1])}else SB.raise("Cannot find element id for inline content")}if(g){gallery.splice(b,1);if(b<current)--current;else if(b==current)current=b>0?current-1:b;--b}}if(gallery.length){options.onOpen&&typeof options.onOpen==p&&options.onOpen(a);if(!activated){setDimensions(options.initialHeight,options.initialWidth);adjustHeight(dims.inner_h,dims.top,u);adjustWidth(dims.width,u);toggleVisible(q)}loadContent();activated=q}};Shadowbox.change=function(a){if(!gallery)return;if(!gallery[a])if(!options.continuous)return;else a=a<0?gallery.length-1:0;if(typeof slide_timer==c){clearTimeout(slide_timer);slide_timer=n;slide_delay=slide_start=0}current=a;options.onChange&&typeof options.onChange==p&&options.onChange(gallery[current]);loadContent()};Shadowbox.next=function(){this.change(current+1)};Shadowbox.previous=function(){this.change(current-1)};Shadowbox.play=function(){if(!hasNext())return;if(!slide_delay)slide_delay=options.slideshowDelay*1e3;if(slide_delay){slide_start=(new Date).getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;SB.next()},slide_delay);toggleNav(E,u);toggleNav(F,q)}};Shadowbox.pause=function(){if(typeof slide_timer==c){var a=(new Date).getTime();slide_delay=Math.max(0,slide_delay-(a-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer=D}toggleNav(F,u);toggleNav(E,q)}};Shadowbox.close=function(){if(!activated)return;listenKeys(u);toggleVisible(u);if(content){content.remove();content=n}typeof slide_timer==c&&clearTimeout(slide_timer);slide_timer=n;slide_delay=0;options.onClose&&typeof options.onClose==p&&options.onClose(gallery[current]);activated=u};Shadowbox.clearCache=function(){for(var a=0,b=cache.length;a<b;++a)if(cache[a].el){SL.removeEvent(cache[a].el,N,handleClick);delete cache[a].el.shadowboxCacheKey}cache=[]};Shadowbox.getPlugins=function(){return plugins};Shadowbox.getOptions=function(){return options};Shadowbox.getCurrent=function(){return gallery[current]};Shadowbox.getVersion=function(){return version};Shadowbox.getClient=function(){return client};Shadowbox.getContent=function(){return content};Shadowbox.getDimensions=function(){return dims};Shadowbox.raise=function(a){if(typeof options.handleException==p)options.handleException(a);else throw a;}})();