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