if(typeof Shadowbox=="undefined")throw"Unable to load Shadowbox, no base library adapter found"; (function(){var g={animate:true,animateFade:true,animSequence:"wh",flvPlayer:"flvplayer.swf",modal:false,overlayColor:"#000",overlayOpacity:0.8,flashBgColor:"#000000",autoplayMovies:true,showMovieControls:true,slideshowDelay:0,resizeDuration:0.55,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:"default",counterLimit:10,viewportPadding:20,handleOversize:"resize",handleException:null,handleUnsupported:"link",initialHeight:160,initialWidth:320,enableKeys:true,onOpen:null, onFinish:null,onChange:null,onClose:null,skipSetup:false,errors:{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"}},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","html","pl","php","php3","php4","php5","phtml","rb","rhtml","shtml","txt","vbs"]}},n=Shadowbox,f=n.lib,E,r={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},u=[],i,j,l,o,R=false,F=false,t,G,y=0,p=navigator.userAgent.toLowerCase(),q={isStrict:document.compatMode== "CSS1Compat",isOpera:p.indexOf("opera")>-1,isIE:p.indexOf("msie")>-1,isIE7:p.indexOf("msie 7")>-1,isSafari:/webkit|khtml/.test(p),isWindows:p.indexOf("windows")!=-1||p.indexOf("win32")!=-1,isMac:p.indexOf("macintosh")!=-1||p.indexOf("mac os x")!=-1,isLinux:p.indexOf("linux")!=-1};q.isBorderBox=q.isIE&&!q.isStrict;q.isSafari3=q.isSafari&&!!document.evaluate;q.isGecko=p.indexOf("gecko")!=-1&&!q.isSafari;var H=q.isIE&&!q.isIE7,v;if(navigator.plugins&&navigator.plugins.length){p=function(a){for(var b= false,c=0,e=navigator.plugins.length;c<e;++c)if(navigator.plugins[c].name.indexOf(a)>-1){b=true;break}return b};var S=p("Flip4Mac");v={fla:p("Shockwave Flash"),qt:p("QuickTime"),wmp:!S&&p("Windows Media"),f4m:S}}else{p=function(a){var b=false;try{if(new ActiveXObject(a))b=true}catch(c){}return b};v={fla:p("ShockwaveFlash.ShockwaveFlash"),qt:p("QuickTime.QuickTime"),wmp:p("wmplayer.ocx"),f4m:false}}var A=function(a,b){for(var c in b)a[c]=b[c];return a},L=function(a){return a&&typeof a.tagName=="string"&& (a.tagName.toUpperCase()=="A"||a.tagName.toUpperCase()=="AREA")};f.getViewportHeight=function(){var a=window.innerHeight;if((document.compatMode||q.isIE)&&!q.isOpera)a=q.isStrict?document.documentElement.clientHeight:document.body.clientHeight;return a};f.getViewportWidth=function(){var a=window.innerWidth;if(document.compatMode||q.isIE)a=q.isStrict?document.documentElement.clientWidth:document.body.clientWidth;return a};f.createHTML=function(a){var b="<"+a.tag;for(var c in a)c=="tag"||c=="html"|| c=="children"||(b+=c=="cls"?' class="'+a.cls+'"':" "+c+'="'+a[c]+'"');if(r.empty.test(a.tag))b+="/>";else{b+=">";if(c=a.children)for(var e=0,d=c.length;e<d;++e)b+=this.createHTML(c[e]);if(a.html)b+=a.html;b+="</"+a.tag+">"}return b};var aa=function(a){return 1+Math.pow(a-1,3)},x=function(a,b,c,e,d){var h=parseFloat(f.getStyle(a,b));if(isNaN(h))h=0;if(h==c)typeof d=="function"&&d();else{var m=c-h;var k=(c=b=="opacity")?"":"px",w=function(B){f.setStyle(a,b,h+B*m+k)};if(!g.animate&&!c||c&&!g.animateFade){w(1); typeof d=="function"&&d()}else{e*=1E3;var s=(new Date).getTime(),I=s+e,J=setInterval(function(){var B=(new Date).getTime();if(B>=I){clearInterval(J);w(1);typeof d=="function"&&d()}else w(aa((B-s)/e))},10)}}},T=function(a){a=a.style;if(q.isIE){if(typeof a.filter=="string"&&/alpha/i.test(a.filter))a.filter=a.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}else{a.opacity="";a["-moz-opacity"]="";a["-khtml-opacity"]=""}},K=function(a){var b=Math.max(a.offsetHeight,a.clientHeight);if(!b){b=parseInt(f.getStyle(a, "height"),10)||0;q.isBorderBox||(b+=parseInt(f.getStyle(a,"padding-top"),10)+parseInt(f.getStyle(a,"padding-bottom"),10)+parseInt(f.getStyle(a,"border-top-width"),10)+parseInt(f.getStyle(a,"border-bottom-width"),10))}return b},ba=function(a){var b=a.match(r.domain);b=b&&document.domain==b[1];if(a.indexOf("#")>-1&&b)return"inline";var c=a.indexOf("?");if(c>-1)a=a.substring(0,c);if(r.img.test(a))return"img";if(r.swf.test(a))return v.fla?"swf":"unsupported-swf";if(r.flv.test(a))return v.fla?"flv":"unsupported-flv"; if(r.qt.test(a))return v.qt?"qt":"unsupported-qt";if(r.wmp.test(a)){if(v.wmp)return"wmp";if(v.f4m)return"qt";if(q.isMac)return v.qt?"unsupported-f4m":"unsupported-qtf4m";return"unsupported-wmp"}else if(r.qtwmp.test(a)){if(v.qt)return"qt";if(v.wmp)return"wmp";return q.isMac?"unsupported-qt":"unsupported-qtwmp"}else if(!b||r.iframe.test(a))return"iframe";return"unsupported"},U=function(a){var b;if(L(this))b=this;else for(b=f.getTarget(a);!L(b)&&b.parentNode;)b=b.parentNode;if(b){n.open(b);i.length&& f.preventDefault(a)}},z=function(a,b){if(a=f.get("shadowbox_nav_"+a))a.style.display=b?"":"none"},ca=function(a){var b=i[j];f.get("shadowbox_title_inner").innerHTML=b.title||"";if(f.get("shadowbox_nav")){var c,e,d,h;if(g.displayNav){b=true;var m=i.length;if(m>1)if(g.continuous)c=h=true;else{c=m-1>j;h=j>0}if(g.slideshowDelay>0&&V()){d=t!="paused";e=!d}}else b=c=e=d=h=false;z("close",b);z("next",c);z("play",e);z("pause",d);z("previous",h)}if(c=f.get("shadowbox_counter")){e="";if(g.displayCounter&&i.length> 1)if(g.counterType=="skip"){d=0;b=m=i.length;h=parseInt(g.counterLimit);if(h<m){b=Math.round(h/2);d=j-b;if(d<0)d+=m;b=j+(h-b);if(b>m)b-=m}for(;d!=b;){if(d==m)d=0;e+='<a onclick="Shadowbox.change('+d+');"';if(d==j)e+=' class="shadowbox_counter_current"';e+=">"+ ++d+"</a>"}}else e=j+1+" "+n.LANG.of+" "+m;c.innerHTML=e}a()},da=function(a,b){var c=f.get("shadowbox_title"),e=f.get("shadowbox_info"),d=f.get("shadowbox_title_inner"),h=f.get("shadowbox_info_inner"),m=function(){ca(b)};c=K(c);e=K(e)*-1;if(a){x(d, "margin-top",c,0.35);x(h,"margin-top",e,0.35,m)}else{f.setStyle(d,"margin-top",c+"px");f.setStyle(h,"margin-top",e+"px");m()}},ea=function(a){var b=f.get("shadowbox_title_inner"),c=f.get("shadowbox_info_inner");b.innerHTML!=""&&x(b,"margin-top",0,0.35);x(c,"margin-top",0,0.35,a)},N=function(){var a=i[j];if(a){var b=false;if(l){l.remove();b=true}var c=a.player=="inline"?"html":a.player;typeof n[c]!="function"&&n.raise("Unknown player "+a.player);l=new n[c]("shadowbox_content",a);M(false);W(true);da(b, function(){if(l){if(!b)f.get("shadowbox").style.display="";var e=function(){X(function(){l&&ea(function(){if(l){f.get("shadowbox_body_inner").innerHTML=f.createHTML(l.markup(o));W(false,function(){if(l){typeof l.onLoad=="function"&&l.onLoad();g.onFinish&&typeof g.onFinish=="function"&&g.onFinish(i[j]);t!="paused"&&n.play();M(true)}})}})})};if(typeof l.ready!="undefined")var d=setInterval(function(){if(l){if(l.ready){clearInterval(d);d=null;e()}}else{clearInterval(d);d=null}},100);else e()}});if(i.length> 1){a=i[j+1]||i[0];if(a.player=="img")(new Image).src=a.content;a=i[j-1]||i[i.length-1];if(a.player=="img")(new Image).src=a.content}}},Y=function(a,b,c){c=c||false;var e=f.get("shadowbox_body"),d=a=parseInt(a),h=b=parseInt(b),m=f.getViewportHeight(),k=f.getViewportWidth(),w=parseInt(f.getStyle(e,"border-left-width"),10)+parseInt(f.getStyle(e,"border-right-width"),10),s=w+2*g.viewportPadding;if(h+s>=k)h=k-s;e=parseInt(f.getStyle(e,"border-top-width"),10)+parseInt(f.getStyle(e,"border-bottom-width"), 10);k=K(f.get("shadowbox_title"))+K(f.get("shadowbox_info"));s=e+2*g.viewportPadding+k;if(d+s>=m)d=m-s;var I=false,J=a,B=b,O=g.handleOversize;if(c&&(O=="resize"||O=="drag")){c=(a-d)/a;var P=(b-h)/b;if(O=="resize"){if(c>P)h=Math.round(b/a*d);else if(P>c)d=Math.round(a/b*h);B=h;J=d}else if(a=i[j])I=a.player=="img"&&(c>0||P>0)}o={height:d+e+k,width:h+w,inner_h:d,inner_w:h,top:(m-(d+s))/2+g.viewportPadding,resize_h:J,resize_w:B,drag:I}},X=function(a){if(l){Y(l.height,l.width,l.resizable);if(a)switch(g.animSequence){case "hw":C(o.inner_h, o.top,true,function(){D(o.width,true,a)});break;case "wh":D(o.width,true,function(){C(o.inner_h,o.top,true,a)});break;case "sync":default:D(o.width,true);C(o.inner_h,o.top,true,a)}else{D(o.width,false);C(o.inner_h,o.top,false);var b=f.get("shadowbox_content");if(b){if(l.resizable&&g.handleOversize=="resize"){b.height=o.resize_h;b.width=o.resize_w}if(i[j].player=="img"&&g.handleOversize=="drag"){parseInt(f.getStyle(b,"top"))+l.height<o.inner_h&&f.setStyle(b,"top",o.inner_h-l.height+"px");parseInt(f.getStyle(b, "left"))+l.width<o.inner_w&&f.setStyle(b,"left",o.inner_w-l.width+"px")}}}}},C=function(a,b,c,e){a=parseInt(a);var d=f.get("shadowbox_body");c?x(d,"height",a,g.resizeDuration):f.setStyle(d,"height",a+"px");a=f.get("shadowbox");if(c)x(a,"top",b,g.resizeDuration,e);else{f.setStyle(a,"top",b+"px");typeof e=="function"&&e()}},D=function(a,b,c){a=parseInt(a);var e=f.get("shadowbox");if(b)x(e,"width",a,g.resizeDuration,c);else{f.setStyle(e,"width",a+"px");typeof c=="function"&&c()}},M=function(a){if(g.enableKeys)f[(a? "add":"remove")+"Event"](document,"keydown",fa)},fa=function(a){var b=f.keyCode(a);f.preventDefault(a);if(b==81||b==88||b==27)n.close();else if(b==37)n.previous();else if(b==39)n.next();else if(b==32)n[typeof t=="number"?"pause":"play"]()},W=function(a,b){var c=f.get("shadowbox_loading");if(a){c.style.display="";typeof b=="function"&&b()}else{a=i[j].player;var e=function(){c.style.display="none";T(c);typeof b=="function"&&b()};a=="img"||a=="html"?x(c,"opacity",0,g.fadeDuration,e):e()}},Q=function(){f.get("shadowbox_container").style.top= document.documentElement.scrollTop+"px"},Z=function(){f.get("shadowbox_overlay").style.height=f.getViewportHeight()+"px"},V=function(){return i.length>1&&(j!=i.length-1||g.continuous)},$=function(a){for(var b,c=a?"hidden":"visible",e=["select","object","embed"],d=0;d<e.length;++d){b=document.getElementsByTagName(e[d]);for(var h=0,m=b.length;h<m;++h)b[h].style.visibility=c}var k=f.get("shadowbox_overlay"),w=f.get("shadowbox_container"),s=f.get("shadowbox");if(a){f.setStyle(k,{backgroundColor:g.overlayColor, opacity:0});g.modal||f.addEvent(k,"click",n.close);if(H){Q();Z();f.addEvent(window,"scroll",Q)}s.style.display="none";w.style.visibility="visible";x(k,"opacity",parseFloat(g.overlayOpacity),g.fadeDuration,a)}else{f.removeEvent(k,"click",n.close);H&&f.removeEvent(window,"scroll",Q);s.style.display="none";x(k,"opacity",0,g.fadeDuration,function(){w.style.visibility="hidden";s.style.display="";T(k)})}};Shadowbox.init=function(a){if(!R)if(typeof n.LANG=="undefined")n.raise("No Shadowbox language loaded"); else if(typeof n.SKIN=="undefined")n.raise("No Shadowbox skin loaded");else{A(g,a||{});a=n.SKIN.markup.replace(/\{(\w+)\}/g,function(m,k){return n.LANG[k]});f.append(document.body||document.documentElement,a);if(H){f.setStyle(f.get("shadowbox_container"),"position","absolute");f.get("shadowbox_body").style.zoom=1;if((a=n.SKIN.png_fix)&&a.constructor==Array)for(var b=0;b<a.length;++b){var c=f.get(a[b]);if(c){var e=f.getStyle(c,"background-image").match(/url\("(.*\.png)"\)/);e&&f.setStyle(c,{backgroundImage:"none", filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+e[1]+",sizingMethod=scale);"})}}}for(var d in g.ext)r[d]=new RegExp(".("+g.ext[d].join("|")+")s*$","i");var h;f.addEvent(window,"resize",function(){if(h){clearTimeout(h);h=null}h=setTimeout(function(){H&&Z();X()},50)});g.skipSetup||n.setup();R=true}};Shadowbox.loadSkin=function(a,b){/\/$/.test(b)||(b+="/");a=b+a+"/";document.write('<link rel="stylesheet" type="text/css" href="'+a+'skin.css">');document.write('<script type="text/javascript" src="'+ a+'skin.js"><\/script>')};Shadowbox.loadLanguage=function(a,b){/\/$/.test(b)||(b+="/");document.write('<script type="text/javascript" src="'+b+"shadowbox-"+a+'.js"><\/script>')};Shadowbox.loadPlayer=function(a,b){if(typeof a=="string")a=[a];/\/$/.test(b)||(b+="/");for(var c=0,e=a.length;c<e;++c)document.write('<script type="text/javascript" src="'+b+"shadowbox-"+a[c]+'.js"><\/script>')};Shadowbox.setup=function(a,b){if(a)a.length||(a=[a]);else{a=[];for(var c=document.getElementsByTagName("a"),e,d= 0,h=c.length;d<h;++d)if((e=c[d].getAttribute("rel"))&&r.rel.test(e))a[a.length]=c[d]}d=0;for(h=a.length;d<h;++d){c=a[d];if(typeof c.shadowboxCacheKey=="undefined"){c.shadowboxCacheKey=u.length;f.addEvent(c,"click",U)}u[c.shadowboxCacheKey]=this.buildCacheObj(c,b)}};Shadowbox.buildCacheObj=function(a,b){var c=a.href;b={el:a,title:a.getAttribute("title"),player:ba(c),options:A({},b||{}),content:c};var e,d=["player","title","height","width","gallery"];c=0;for(var h=d.length;c<h;++c){e=d[c];if(typeof b.options[e]!= "undefined"){b[e]=b.options[e];delete b.options[e]}}if(c=a.getAttribute("rel")){if(a=c.match(r.gallery))b.gallery=escape(a[2]);e=c.split(";");c=0;for(h=e.length;c<h;++c)if(a=e[c].match(r.param))if(a[1]=="options")eval("apply(o.options, "+a[2]+")");else b[a[1]]=a[2]}return b};Shadowbox.applyOptions=function(a){if(a){E=A({},g);g=A(g,a)}};Shadowbox.revertOptions=function(){if(E){g=E;E=null}};Shadowbox.open=function(a,b){this.revertOptions();if(L(a))a=typeof a.shadowboxCacheKey=="undefined"||typeof u[a.shadowboxCacheKey]== "undefined"?this.buildCacheObj(a,b):u[a.shadowboxCacheKey];if(a.constructor==Array){i=a;j=0}else{var c=A({},a);if(a.gallery){j=null;i=[];for(var e,d=0,h=u.length;d<h;++d){e=u[d];if(e.gallery){if(e.content==a.content&&e.gallery==a.gallery&&e.title==a.title)j=i.length;e.gallery==a.gallery&&i.push(A({},e))}}if(j==null){i.unshift(c);j=0}}else{i=[c];j=0}}a=i[j];if(a.options||b)this.applyOptions(A(A({},a.options||{}),b||{}));d=0;for(h=i.length;d<h;++d){b=false;if(i[d].player=="unsupported")b=true;else if(c= r.unsupported.exec(i[d].player))if(g.handleUnsupported=="link"){i[d].player="html";var m,k=g.errors;switch(c[1]){case "qtwmp":e="either";m=[k.qt.url,k.qt.name,k.wmp.url,k.wmp.name];break;case "qtf4m":e="shared";m=[k.qt.url,k.qt.name,k.f4m.url,k.f4m.name];break;default:e="single";if(c[1]=="swf"||c[1]=="flv")c[1]="fla";m=[k[c[1]].url,k[c[1]].name]}c=n.LANG.errors[e].replace(/\{(\d+)\}/g,function(w,s){return m[s]});i[d].content='<div class="shadowbox_message">'+c+"</div>"}else b=true;else if(i[d].player== "inline")if(c=r.inline.exec(i[d].content))if(e=f.get(c[1]))i[d].content=e.innerHTML;else n.raise("Cannot find element with id "+c[1]);else n.raise("Cannot find element id for inline content");if(b){i.splice(d,1);if(d<j)--j;else if(d==j)j=d>0?j-1:d;--d;h=i.length}}if(i.length){g.onOpen&&typeof g.onOpen=="function"&&g.onOpen(a);if(F)N();else{Y(g.initialHeight,g.initialWidth);C(o.inner_h,o.top,false);D(o.width,false);$(N)}F=true}};Shadowbox.change=function(a){if(i){if(!i[a])if(g.continuous)a=a<0?i.length- 1:0;else return;if(typeof t=="number"){clearTimeout(t);t=null;y=G=0}j=a;g.onChange&&typeof g.onChange=="function"&&g.onChange(i[j]);N()}};Shadowbox.next=function(){this.change(j+1)};Shadowbox.previous=function(){this.change(j-1)};Shadowbox.play=function(){if(V()){y||(y=g.slideshowDelay*1E3);if(y){G=(new Date).getTime();t=setTimeout(function(){y=G=0;n.next()},y);z("play",false);z("pause",true)}}};Shadowbox.pause=function(){if(typeof t=="number"){var a=(new Date).getTime();if(y=Math.max(0,y-(a-G))){clearTimeout(t); t="paused"}z("pause",false);z("play",true)}};Shadowbox.close=function(){if(F){M(false);$(false);if(l){l.remove();l=null}typeof t=="number"&&clearTimeout(t);t=null;y=0;g.onClose&&typeof g.onClose=="function"&&g.onClose(i[j]);F=false}};Shadowbox.clearCache=function(){for(var a=0,b=u.length;a<b;++a)if(u[a].el){f.removeEvent(u[a].el,"click",U);delete u[a].el.shadowboxCacheKey}u=[]};Shadowbox.getPlugins=function(){return v};Shadowbox.getOptions=function(){return g};Shadowbox.getCurrent=function(){return i[j]}; Shadowbox.getVersion=function(){return"2.0"};Shadowbox.getClient=function(){return q};Shadowbox.getContent=function(){return l};Shadowbox.getDimensions=function(){return o};Shadowbox.raise=function(a){if(typeof g.handleException=="function")g.handleException(a);else throw a;}})();