/*
     http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL 3.0
 @version     SVN: $Id: shadowbox.js 75 2008-02-21 16:51:29Z mjijackson $
*/
if(typeof Shadowbox=="undefined")throw"Unable to load Shadowbox, no base library adapter found.";
(function(){var d={assetURL:"",loadingImage:"images/loading.gif",animate:!0,animSequence:"wh",flvPlayer:"flvplayer.swf",overlayColor:"#000",overlayOpacity:0.85,overlayBgImage:"images/overlay-85.png",listenOverlay:!0,autoplayMovies:!0,showMovieControls:!0,resizeDuration:0.35,fadeDuration:0.35,displayNav:!0,continuous:!1,displayCounter:!0,counterType:"default",viewportPadding:20,handleLgImages:"resize",initialHeight:160,initialWidth:320,enableKeys:!0,keysClose:["c","q",27],keysNext:["n",39],keysPrev:["p",
37],onOpen:null,onFinish:null,onChange:null,onClose:null,handleUnsupported:"link",skipSetup:!1,text:{cancel:"Cancel",loading:"loading",close:'<span class="shortcut">C</span>lose',next:'<span class="shortcut">N</span>ext',prev:'<span class="shortcut">P</span>revious',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.'}},
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"}},skin:{main:'<div id="shadowbox_overlay"></div><div id="shadowbox_container"><div id="shadowbox"><div id="shadowbox_title"><div id="shadowbox_title_inner"></div></div><div id="shadowbox_body"><div id="shadowbox_body_inner"></div><div id="shadowbox_loading"></div></div><div id="shadowbox_toolbar"><div id="shadowbox_toolbar_inner"></div></div></div></div>',
loading:'<img src="{0}" alt="{1}" /><span><a href="javascript:Shadowbox.close();">{2}</a></span>',counter:'<div id="shadowbox_counter">{0}</div>',close:'<div id="shadowbox_nav_close"><a href="javascript:Shadowbox.close();">{0}</a></div>',next:'<div id="shadowbox_nav_next"><a href="javascript:Shadowbox.next();">{0}</a></div>',prev:'<div id="shadowbox_nav_previous"><a href="javascript:Shadowbox.previous();">{0}</a></div>'},ext:{img:["png","jpg","jpeg","gif","bmp"],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"]}},o=null,c=Shadowbox.lib,k={resize:/(img|swf|flv)/,overlay:/(img|iframe|html|inline)/,swf:/\.swf\s*$/i,flv:/\.flv\s*$/i,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},
q=[],j,l,D=d.initialHeight,E=d.initialWidth,T=0,U=0,s,V=!1,w=!1,n,K,x,m=navigator.userAgent.toLowerCase(),y=document.compatMode=="CSS1Compat",ga=m.indexOf("opera")>-1,r=m.indexOf("msie")>-1,F=m.indexOf("msie 7")>-1,ha=r&&!y,L=/webkit|khtml/.test(m),ia=L&&!!document.evaluate,z=!L&&m.indexOf("gecko")>-1;m.indexOf("windows")!=-1||m.indexOf("win32");var M=m.indexOf("macintosh")!=-1||m.indexOf("mac os x")!=-1;m.indexOf("linux");var N=r&&!F,p=null;navigator.plugins&&navigator.plugins.length?(m=function(a){for(var b=
!1,c=0,d=navigator.plugins.length;c<d;++c)if(navigator.plugins[c].name.indexOf(a)>-1){b=!0;break}return b},F=m("Flip4Mac"),p={fla:m("Shockwave Flash"),qt:m("QuickTime"),wmp:!F&&m("Windows Media"),f4m:F}):(m=function(a){var b=!1;try{new ActiveXObject(a)&&(b=!0)}catch(c){}return b},p={fla:m("ShockwaveFlash.ShockwaveFlash"),qt:m("QuickTime.QuickTime"),wmp:m("wmplayer.ocx"),f4m:!1});var t=function(a,b){for(var c in b)a[c]=b[c];return a},O=function(a){return typeof a.tagName=="string"&&(a.tagName.toUpperCase()==
"A"||a.tagName.toUpperCase()=="AREA")};c.getViewportHeight=function(){var a=window.innerHeight;if((document.compatMode||r)&&!ga)a=y?document.documentElement.clientHeight:document.body.clientHeight;return a};c.getViewportWidth=function(){var a=window.innerWidth;if(document.compatMode||r)a=y?document.documentElement.clientWidth:document.body.clientWidth;return a};c.getDocumentHeight=function(){return Math.max(y?document.documentElement.scrollHeight:document.body.scrollHeight,c.getViewportHeight())};
c.getDocumentWidth=function(){return Math.max(y?document.documentElement.scrollWidth:document.body.scrollWidth,c.getViewportWidth())};var P=function(a){if(r){if(typeof a.style.filter=="string"&&/alpha/i.test(a.style.filter))a.style.filter=""}else a.style.opacity="",a.style["-moz-opacity"]="",a.style["-khtml-opacity"]=""},ja=function(a,b,e,g){d.animate?(c.setStyle(a,"opacity",0),a.style.visibility="visible",c.animate(a,{opacity:{to:b}},e,function(){b==1&&P(a);typeof g=="function"&&g()})):(b==1?P(a):
c.setStyle(a,"opacity",b),a.style.visibility="visible",typeof g=="function"&&g())},W=function(a,b,e){var g=function(){a.style.visibility="hidden";P(a);typeof e=="function"&&e()};d.animate?c.animate(a,{opacity:{to:0}},b,g):g()},u=function(a,b){a=c.get(a);if(a.insertAdjacentHTML)return a.insertAdjacentHTML("BeforeEnd",b),a.lastChild;if(a.lastChild){var e=a.ownerDocument.createRange();e.setStartAfter(a.lastChild);e=e.createContextualFragment(b);a.appendChild(e)}else a.innerHTML=b;return a.lastChild},
G=function(a){var b=Math.max(a.offsetHeight,a.clientHeight);b||(b=parseInt(c.getStyle(a,"height"),10)||0,ha||(b+=parseInt(c.getStyle(a,"padding-top"),10)+parseInt(c.getStyle(a,"padding-bottom"),10)+parseInt(c.getStyle(a,"border-top-width"),10)+parseInt(c.getStyle(a,"border-bottom-width"),10)));return b},ka=function(a){if(k.img.test(a))return"img";var b=a.match(k.domain),b=b?document.domain==b[1]:!1;if(a.indexOf("#")>-1&&b)return"inline";var c=a.indexOf("?");c>-1&&(a=a.substring(0,c));if(k.swf.test(a))return p.fla?
"swf":"unsupported-swf";if(k.flv.test(a))return p.fla?"flv":"unsupported-flv";if(k.qt.test(a))return p.qt?"qt":"unsupported-qt";if(k.wmp.test(a))return p.wmp?"wmp":p.f4m?"qt":M?p.qt?"unsupported-f4m":"unsupported-qtf4m":"unsupported-wmp";else if(k.qtwmp.test(a))return p.qt?"qt":p.wmp?"wmp":M?"unsupported-qt":"unsupported-qtwmp";else if(!b||k.iframe.test(a))return"iframe";return"unsupported"},X=function(a){var b;if(O(this))b=this;else for(b=c.getTarget(a);!O(b)&&b.parentNode;)b=b.parentNode;Shadowbox.open(b);
j.length&&c.preventDefault(a)},la=function(a){var b=t({},a);if(a.gallery){j=[];for(var e,g,f=0,h=q.length;f<h;++f)if(g=q[f],g.gallery){if(g.content==a.content&&g.gallery==a.gallery&&g.title==a.title)e=j.length;g.gallery==a.gallery&&j.push(t({},g))}e==null&&(j.unshift(b),e=0);l=e}else j=[b],l=0;f=0;for(h=j.length;f<h;++f){a=!1;if(j[f].type=="unsupported")a=!0;else if(b=k.unsupported.exec(j[f].type))if(d.handleUnsupported=="link"){j[f].type="html";switch(b[1]){case "qtwmp":b=String.format(d.text.errors.either,
d.errors.qt.url,d.errors.qt.name,d.errors.wmp.url,d.errors.wmp.name);break;case "qtf4m":b=String.format(d.text.errors.shared,d.errors.qt.url,d.errors.qt.name,d.errors.f4m.url,d.errors.f4m.name);break;default:if(b[1]=="swf"||b[1]=="flv")b[1]="fla";b=String.format(d.text.errors.single,d.errors[b[1]].url,d.errors[b[1]].name)}j[f]=t(j[f],{height:160,width:320,content:'<div class="shadowbox_message">'+b+"</div>"})}else a=!0;else if(j[f].type=="inline")if(b=k.inline.exec(j[f].content))if(e=c.get(b[1]))j[f].content=
e.innerHTML;else throw"No element found with id "+b[1];else throw"No element id found for inline content";a&&(j.splice(f,1),f<l&&--l,--f)}},ma=function(){var a=j[l];if(a){c.get("shadowbox_title_inner").innerHTML=a.title?a.title:"";a=c.get("shadowbox_toolbar_inner");a.innerHTML="";if(d.displayNav)a.innerHTML=String.format(d.skin.close,d.text.close),j.length>1&&(d.continuous?(u(a,String.format(d.skin.next,d.text.next)),u(a,String.format(d.skin.prev,d.text.prev))):(j.length-1>l&&u(a,String.format(d.skin.next,
d.text.next)),l>0&&u(a,String.format(d.skin.prev,d.text.prev))));if(j.length>1&&d.displayCounter){var b="";if(d.counterType=="skip")for(var e=0,g=j.length;e<g;++e)b+='<a href="javascript:Shadowbox.change('+e+');"',e==l&&(b+=' class="shadowbox_counter_current"'),b+=">"+(e+1)+"</a>";else b=l+1+" of "+j.length;u(a,String.format(d.skin.counter,b))}}},Y=function(a){var b=G(c.get("shadowbox_title")),e=0-G(c.get("shadowbox_toolbar")),g=c.get("shadowbox_title_inner"),f=c.get("shadowbox_toolbar_inner");d.animate&&
a?(c.animate(g,{marginTop:{to:b}},0.2),c.animate(f,{marginTop:{to:e}},0.2,a)):(c.setStyle(g,"marginTop",b+"px"),c.setStyle(f,"marginTop",e+"px"))},H=function(a){var b=c.get("shadowbox_title_inner");d.animate?(b.innerHTML!=""&&c.animate(b,{marginTop:{to:0}},0.35),c.animate(c.get("shadowbox_toolbar_inner"),{marginTop:{to:0}},0.35,a)):(b.innerHTML!=""&&c.setStyle(b,"margin-top","0px"),c.setStyle(c.get("shadowbox_toolbar_inner"),"margin-top","0px"),a())},Q=function(a){if(a)n={x:0,y:0,start_x:null,start_y:null},
a=["position:absolute","cursor:"+(z?"-moz-grab":"move")],a.push(r?"background-color:#fff;filter:alpha(opacity=0)":"background-color:transparent"),u("shadowbox_body_inner",'<div id="shadowbox_drag_layer" style="'+a.join(";")+'"></div>'),c.addEvent(c.get("shadowbox_drag_layer"),"mousedown",Z);else if(a=c.get("shadowbox_drag_layer"))c.removeEvent(a,"mousedown",Z),c.remove(a)},Z=function(a){n.start_x=a.clientX;n.start_y=a.clientY;K=c.get("shadowbox_content");c.addEvent(document,"mousemove",$);c.addEvent(document,
"mouseup",aa);z&&c.setStyle(c.get("shadowbox_drag_layer"),"cursor","-moz-grabbing")},aa=function(){c.removeEvent(document,"mousemove",$);c.removeEvent(document,"mouseup",aa);z&&c.setStyle(c.get("shadowbox_drag_layer"),"cursor","-moz-grab")},$=function(a){var b=a.clientY-n.start_y;n.start_y+=b;n.y=Math.max(Math.min(0,n.y+b),T-D);c.setStyle(K,"top",n.y+"px");a=a.clientX-n.start_x;n.start_x+=a;n.x=Math.max(Math.min(0,n.x+a),U-E);c.setStyle(K,"left",n.x+"px")},ba=function(){var a=j[l];if(a){ma();switch(a.type){case "img":s=
new Image;s.onload=function(){var b=a.height?parseInt(a.height,10):s.height,e=a.width?parseInt(a.width,10):s.width;A(b,e,function(b){H(function(){v({tag:"img",height:b.i_height,width:b.i_width,src:a.content,style:"position:absolute"});b.enableDrag&&d.handleLgImages=="drag"&&(Q(!0),c.setStyle(c.get("shadowbox_drag_layer"),{height:b.i_height+"px",width:b.i_width+"px"}));I()})});s.onload=function(){}};s.src=a.content;break;case "swf":case "flv":case "qt":case "wmp":var b=Shadowbox.movieMarkup(a);A(b.height,
b.width,function(){H(function(){v(b);I()})});break;case "iframe":var e=a.height?parseInt(a.height,10):c.getViewportHeight(),g=a.width?parseInt(a.width,10):c.getViewportWidth(),f={tag:"iframe",name:"shadowbox_content",height:"100%",width:"100%",frameborder:"0",marginwidth:"0",marginheight:"0",scrolling:"auto"};A(e,g,function(){H(function(){v(f);(r?c.get("shadowbox_content").contentWindow:window.frames.shadowbox_content).location=a.content;I()})});break;case "html":case "inline":e=a.height?parseInt(a.height,
10):c.getViewportHeight();g=a.width?parseInt(a.width,10):c.getViewportWidth();f={tag:"div",cls:"html",html:a.content};A(e,g,function(){H(function(){v(f);I()})});break;default:throw"Shadowbox cannot open content of type "+a.type;}if(j.length>0){(e=j[l+1])||(e=j[0]);if(e.type=="img")(new Image).src=e.href;(e=j[l-1])||(e=j[j.length-1]);if(e.type=="img")(new Image).src=e.href}}},v=function(a){var b=c.get("shadowbox_content");if(b)switch(b.tagName.toUpperCase()){case "OBJECT":var e=j[a?l-1:l];if(e.type==
"wmp"&&r)try{shadowbox_content.controls.stop(),shadowbox_content.URL="non-existent.wmv",window.shadowbox_content=function(){}}catch(d){}else if(e.type=="qt"&&L){try{document.shadowbox_content.Stop()}catch(f){}b.innerHTML=""}setTimeout(function(){c.remove(b)},10);break;case "IFRAME":c.remove(b);z&&delete window.frames.shadowbox_content;break;default:c.remove(b)}if(a){if(!a.id)a.id="shadowbox_content";return u("shadowbox_body_inner",Shadowbox.createHTML(a))}return null},I=function(){var a=j[l];a&&na(function(){R(!0);
if(d.onFinish&&typeof d.onFinish=="function")d.onFinish(a)})},A=function(a,b,e){D=a;E=b;var a=k.resize.test(j[l].type),g=J(D,E,a);if(e){var f=function(){e(g)};switch(d.animSequence){case "hw":B(g.height,g.top,!0,function(){C(g.width,!0,f)});break;case "wh":C(g.width,!0,function(){B(g.height,g.top,!0,f)});break;default:C(g.width,!0),B(g.height,g.top,!0,f)}}else if(C(g.width,!1),B(g.height,g.top,!1),d.handleLgImages=="resize"&&a&&(a=c.get("shadowbox_content")))a.height=g.i_height,a.width=g.i_width},
J=function(a,b,e){typeof e=="undefined"&&(e=!1);var g=a=parseInt(a),f=b=parseInt(b),h=c.get("shadowbox_body"),k=c.getViewportHeight(),m=parseInt(c.getStyle(h,"border-top-width"),10)+parseInt(c.getStyle(h,"border-bottom-width"),10)+parseInt(c.getStyle(h,"margin-top"),10)+parseInt(c.getStyle(h,"margin-bottom"),10)+G(c.get("shadowbox_title"))+G(c.get("shadowbox_toolbar"))+2*d.viewportPadding;g+m>=k&&(g=k-m);var n=c.getViewportWidth(),h=parseInt(c.getStyle(h,"border-left-width"),10)+parseInt(c.getStyle(h,
"border-right-width"),10)+parseInt(c.getStyle(h,"margin-left"),10)+parseInt(c.getStyle(h,"margin-right"),10),o=h+2*d.viewportPadding;f+o>=n&&(f=n-o);var n=!1,o=a,q=b,p=d.handleLgImages;if(e&&(p=="resize"||p=="drag")){var e=(a-g)/a,r=(b-f)/b;p=="resize"?(e>r?f=Math.round(b/a*g):r>e&&(g=Math.round(a/b*f)),q=f,o=g):(a=j[l])&&(n=a.type=="img"&&(e>0||r>0))}return{height:g,width:f+h,i_height:o,i_width:q,top:(k-(g+m))/2+d.viewportPadding,enableDrag:n}},S=function(){var a=c.get("shadowbox"),b=document.documentElement.scrollTop+
Math.round((c.getViewportHeight()-(a.offsetHeight||0))/2);c.setStyle(a,"top",b+"px")},B=function(a,b,e,g){T=a=parseInt(a);var f=c.get("shadowbox_body_inner");e&&d.animate?c.animate(f,{height:{to:a}},d.resizeDuration,g):(c.setStyle(f,"height",a+"px"),typeof g=="function"&&g());N&&(S(),c.addEvent(window,"scroll",S),b+=document.documentElement.scrollTop);a=c.get("shadowbox");e&&d.animate?c.animate(a,{top:{to:b}},d.resizeDuration):c.setStyle(a,"top",b+"px")},C=function(a,b,e){U=a=parseInt(a);var g=c.get("shadowbox");
b&&d.animate?c.animate(g,{width:{to:a}},d.resizeDuration,e):(c.setStyle(g,"width",a+"px"),typeof e=="function"&&e())},R=function(a){if(d.enableKeys)document.onkeydown=a?oa:""},oa=function(a){var a=a?a.which:event.keyCode,b=String.fromCharCode(a).toLowerCase();d.keysClose.indexOf(b)!=-1||d.keysClose.indexOf(a)!=-1?Shadowbox.close():d.keysPrev.indexOf(b)!=-1||d.keysPrev.indexOf(a)!=-1?Shadowbox.previous():(d.keysNext.indexOf(b)!=-1||d.keysNext.indexOf(a)!=-1)&&Shadowbox.next()},ca=function(a){var a=
a?"visible":"hidden",b=document.getElementsByTagName("select");i=0;for(len=b.length;i<len;++i)b[i].style.visibility=a;b=document.getElementsByTagName("object");i=0;for(len=b.length;i<len;++i)b[i].style.visibility=a;b=document.getElementsByTagName("embed");i=0;for(len=b.length;i<len;++i)b[i].style.visibility=a},da=function(){var a=c.get("shadowbox_loading"),b=a,e=String.format(d.skin.loading,d.assetURL+d.loadingImage,d.text.loading,d.text.cancel),b=c.get(b);b.innerHTML=e;a.style.visibility="visible"},
na=function(a){var b=j[l].type,b=b=="img"||b=="html",e=c.get("shadowbox_loading");b?W(e,0.35,a):(e.style.visibility="hidden",a())},ea=function(){var a=c.get("shadowbox_overlay");c.setStyle(a,{height:"100%",width:"100%"});c.setStyle(a,"height",c.getDocumentHeight()+"px");ia||c.setStyle(a,"width",c.getDocumentWidth()+"px")},pa=function(){if(!z||!M)return!1;for(var a=0,b=j.length;a<b;++a)if(!k.overlay.exec(j[a].type))return!0;return!1},fa=function(a){var b=c.get("shadowbox_overlay");x==null&&(x=pa());
a?(ea(),x?(c.setStyle(b,{visibility:"visible",backgroundColor:"transparent",backgroundImage:"url("+d.assetURL+d.overlayBgImage+")",backgroundRepeat:"repeat",opacity:1}),a()):(c.setStyle(b,{visibility:"visible",backgroundColor:d.overlayColor,backgroundImage:"none"}),ja(b,d.overlayOpacity,d.fadeDuration,a))):(x?c.setStyle(b,"visibility","hidden"):W(b,d.fadeDuration),x=null)};Shadowbox.init=function(a){if(!V){d=t(d,a||{});u(document.body,d.skin.main);k.img=RegExp(".("+d.ext.img.join("|")+")s*$","i");
k.qt=RegExp(".("+d.ext.qt.join("|")+")s*$","i");k.wmp=RegExp(".("+d.ext.wmp.join("|")+")s*$","i");k.qtwmp=RegExp(".("+d.ext.qtwmp.join("|")+")s*$","i");k.iframe=RegExp(".("+d.ext.iframe.join("|")+")s*$","i");var b=null,e=function(){clearInterval(b);b=null;ea();A(D,E)};c.addEvent(window,"resize",function(){w&&(b&&(clearInterval(b),b=null),b||(b=setInterval(e,50)))});d.listenOverlay&&c.addEvent(c.get("shadowbox_overlay"),"click",Shadowbox.close);N&&(c.setStyle(c.get("shadowbox_container"),"position",
"absolute"),c.setStyle("shadowbox_body","zoom",1),c.addEvent(c.get("shadowbox_container"),"click",function(a){a=c.getTarget(a);a.id&&a.id=="shadowbox_container"&&Shadowbox.close()}));d.skipSetup||Shadowbox.setup();V=!0}};Shadowbox.setup=function(a,b){if(a)a.length||(a=[a]);else for(var a=[],e=document.getElementsByTagName("a"),d,f=0,h=e.length;f<h;++f)(d=e[f].getAttribute("rel"))&&k.rel.test(d)&&(a[a.length]=e[f]);f=0;for(h=a.length;f<h;++f){e=a[f];if(typeof e.shadowboxCacheKey=="undefined")e.shadowboxCacheKey=
q.length,c.addEvent(e,"click",X);q[e.shadowboxCacheKey]=this.buildCacheObj(e,b)}};Shadowbox.buildCacheObj=function(a,b){for(var c=a.href,c={el:a,title:a.getAttribute("title"),type:ka(c),options:t({},b||{}),content:c},d,f=["title","type","height","width","gallery"],h=0,j=f.length;h<j;++h)d=f[h],typeof c.options[d]!="undefined"&&(c[d]=c.options[d],delete c.options[d]);if(h=a.getAttribute("rel")){if(d=h.match(k.gallery))c.gallery=escape(d[2]);f=h.split(";");h=0;for(j=f.length;h<j;++h)(d=f[h].match(k.param))&&
(d[1]=="options"?eval("o.options = apply(o.options, "+d[2]+")"):c[d[1]]=d[2])}return c};Shadowbox.applyOptions=function(a){a&&(o=t({},d),d=t(d,a))};Shadowbox.revertOptions=function(){o&&(d=o,o=null)};Shadowbox.open=function(a,b){if(!w){w=!0;O(a)&&(a=typeof a.shadowboxCacheKey=="undefined"||typeof q[a.shadowboxCacheKey]=="undefined"?this.buildCacheObj(a,b):q[a.shadowboxCacheKey]);this.revertOptions();if(a.options||b)this.applyOptions(t(t({},a.options||{}),b||{}));la(a);if(j.length){if(d.onOpen&&typeof d.onOpen==
"function")d.onOpen(a);c.setStyle(c.get("shadowbox"),"display","block");ca(!1);var e=J(d.initialHeight,d.initialWidth);B(e.height,e.top);C(e.width);Y(!1);fa(function(){c.setStyle(c.get("shadowbox"),"visibility","visible");da();ba()})}}};Shadowbox.change=function(a){if(j){if(!j[a])if(d.continuous)a=a<0?j.length-1:0;else return;l=a;Q(!1);v(null);R(!1);if(d.onChange&&typeof d.onChange=="function")d.onChange(j[l]);da();Y(ba)}};Shadowbox.next=function(){return this.change(l+1)};Shadowbox.previous=function(){return this.change(l-
1)};Shadowbox.close=function(){if(w){R(!1);c.setStyle(c.get("shadowbox"),{display:"none",visibility:"hidden"});N&&c.removeEvent(window,"scroll",S);Q(!1);v(null);if(s)s.onload=function(){},s=null;fa(!1);ca(!0);if(d.onClose&&typeof d.onClose=="function")d.onClose(j[l]);w=!1}};Shadowbox.clearCache=function(){for(var a=0,b=q.length;a<b;++a)q[a].el&&(c.removeEvent(q[a].el,"click",X),delete q[a].shadowboxCacheKey);q=[]};Shadowbox.movieMarkup=function(a){var b=a.height?parseInt(a.height,10):300,c=a.width?
parseInt(a.width,10):300,g=d.autoplayMovies,f=d.showMovieControls;if(a.options){if(a.options.autoplayMovies!=null)g=a.options.autoplayMovies;if(a.options.showMovieControls!=null)f=a.options.showMovieControls}var h={tag:"object",name:"shadowbox_content"};switch(a.type){case "swf":c=J(b,c,!0);b=c.height;c=c.width;h.type="application/x-shockwave-flash";h.data=a.content;h.children=[{tag:"param",name:"movie",value:a.content}];break;case "flv":var g=g?"true":"false",j="false",k=b/c;f&&(j="true",b+=20);
c=J(b,b/k,!0);b=c.height;c=(b-(f?20:0))/k;a=["file="+a.content,"height="+b,"width="+c,"autostart="+g,"displayheight="+(b-(f?20:0)),"showicons="+j,"backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x557722"];h.type="application/x-shockwave-flash";h.data=d.assetURL+d.flvPlayer;h.children=[{tag:"param",name:"movie",value:d.assetURL+d.flvPlayer},{tag:"param",name:"flashvars",value:a.join("&amp;")},{tag:"param",name:"allowfullscreen",value:"true"}];break;case "qt":f?(f="true",b+=16):f="false";
h.children=[{tag:"param",name:"src",value:a.content},{tag:"param",name:"scale",value:"aspect"},{tag:"param",name:"controller",value:f},{tag:"param",name:"autoplay",value:g?"true":"false"}];r?(h.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",h.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"):(h.type="video/quicktime",h.data=a.content);break;case "wmp":h.children=[{tag:"param",name:"autostart",value:g?1:0}],r?(f?(f="full",b+=70):f="none",h.classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6",
h.children[h.children.length]={tag:"param",name:"url",value:a.content},h.children[h.children.length]={tag:"param",name:"uimode",value:f}):(f?(f=1,b+=45):f=0,h.type="video/x-ms-wmv",h.data=a.content,h.children[h.children.length]={tag:"param",name:"showcontrols",value:f})}h.height=b;h.width=c;return h};Shadowbox.createHTML=function(a){var b="<"+a.tag,c;for(c in a)c=="tag"||c=="html"||c=="children"||(b+=c=="cls"?' class="'+a.cls+'"':" "+c+'="'+a[c]+'"');if(k.empty.test(a.tag))b+="/>\n";else{b+=">\n";
if(c=a.children)for(var d=0,f=c.length;d<f;++d)b+=this.createHTML(c[d]);a.html&&(b+=a.html);b+="</"+a.tag+">\n"}return b};Shadowbox.getPlugins=function(){return p};Shadowbox.getOptions=function(){return d};Shadowbox.getCurrent=function(){return j[l]};Shadowbox.getVersion=function(){return"1.0"}})();Array.prototype.indexOf=Array.prototype.indexOf||function(d){for(var o=0,c=this.length;o<c;++o)if(this[o]==d)return o;return-1};
String.format=String.format||function(d){var o=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(c,d){return o[d]})};
