(function(){var ua=navigator.useragent.tolowercase(),s={version:"3.0rc1",adapter:null,cache:[],client:{isie:ua.indexof("msie")>-1,isie6:ua.indexof("msie 6")>-1,isie7:ua.indexof("msie 7")>-1,isgecko:ua.indexof("gecko")>-1&&ua.indexof("safari")==-1,iswebkit:ua.indexof("applewebkit/")>-1,iswindows:ua.indexof("windows")>-1||ua.indexof("win32")>-1,ismac:ua.indexof("macintosh")>-1||ua.indexof("mac os x")>-1,islinux:ua.indexof("linux")>-1},content:null,current:-1,dimensions:null,gallery:[],expando:"shadowboxcachekey",libraries:{prototype:"prototype",jquery:"jquery",mootools:"mootools",yahoo:"yui",dojo:"dojo",ext:"ext"},options:{adapter:null,animate:true,animatefade:true,autoplaymovies:true,continuous:false,ease:function(x){return 1+math.pow(x-1,3)},enablekeys:true,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","m4v"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"]},flashparams:{bgcolor:"#000000",allowfullscreen:true},flashvars:{},flashversion:"9.0.115",handleoversize:"resize",handleunsupported:"link",language:"en",onchange:null,onclose:null,onfinish:null,onopen:null,players:["img"],showmoviecontrols:true,skipsetup:false,slideshowdelay:0,usesizzle:true,viewportpadding:20},path:"",plugins:null,ready:false,regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},applyoptions:function(opts){if(opts){default_options=apply({},s.options);apply(s.options,opts)}},revertoptions:function(){apply(s.options,default_options)},change:function(index){if(!s.gallery){return}if(!s.gallery[index]){if(!s.options.continuous){return}else{index=index<0?s.gallery.length-1:0}}s.current=index;if(typeof slide_timer=="number"){cleartimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(s.options.onchange){s.options.onchange()}loadcontent()},close:function(){if(!active){return}active=false;listenkeys(false);if(s.content){s.content.remove();s.content=null}if(typeof slide_timer=="number"){cleartimeout(slide_timer)}slide_timer=null;slide_delay=0;if(s.options.onclose){s.options.onclose()}s.skin.onclose();s.revertoptions()},contentid:function(){return content_id},error:function(msg){if(!s.debug){return}if(typeof window.console!="undefined"&&typeof console.log=="function"){console.log(msg)}else{alert(msg)}},getcurrent:function(){return s.current>-1?s.gallery[s.current]:null},hasnext:function(){return s.gallery.length>1&&(s.current!=s.gallery.length-1||s.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(s.options,opts)}for(var e in s.options.ext){s.regex[e]=new regexp(".("+s.options.ext[e].join("|")+")s*$","i")}if(!s.path){var pathre=/(.+\/)shadowbox\.js/i,path;each(document.getelementsbytagname("script"),function(s){path=pathre.exec(s.src);if(path){s.path=path[1];return false}})}if(s.options.adapter){s.adapter=s.options.adapter.tolowercase()}else{for(var lib in s.libraries){if(typeof window[lib]!="undefined"){s.adapter=s.libraries[lib];break}}if(!s.adapter){s.adapter="base"}}if(s.options.usesizzle&&!window.sizzle){if(window.jquery){window.sizzle=jquery.find}else{u.include(s.path+"libraries/sizzle/sizzle.js")}}if(!s.lang){u.include(s.path+"languages/shadowbox-"+s.options.language+".js")}each(s.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){u.include(s.path+"libraries/swfobject/swfobject.js")}if(!s[p]){u.include(s.path+"players/shadowbox-"+p+".js")}});if(!s.lib){u.include(s.path+"adapters/shadowbox-"+s.adapter+".js")}waitdom(waitlibs)},isactive:function(){return active},ispaused:function(){return slide_timer=="paused"},load:function(){if(s.ready){return}s.ready=true;if(s.skin.options){apply(s.options,s.skin.options);apply(s.options,init_options)}s.skin.init();if(!s.options.skipsetup){s.setup()}},next:function(){s.change(s.current+1)},open:function(obj){if(u.islink(obj)){if(s.incache(obj)){obj=s.cache[obj[s.expando]]}else{obj=s.buildcacheobj(obj)}}if(obj.constructor==array){s.gallery=obj;s.current=0}else{if(!obj.gallery){s.gallery=[obj];s.current=0}else{s.current=null;s.gallery=[];each(s.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(s.current==null&&c.content==obj.content&&c.title==obj.title){s.current=s.gallery.length}s.gallery.push(c)}});if(s.current==null){s.gallery.unshift(obj);s.current=0}}}obj=s.getcurrent();if(obj.options){s.revertoptions();s.applyoptions(obj.options)}var item,remove,m,format,replace,oe=s.options.errors,msg,el;for(var i=0;i"}else{remove=true}}else{if(item.player=="inline"){m=s.regex.inline.exec(item.content);if(m){var el=u.get(m[1]);if(el){item.content=el.innerhtml}else{s.error("cannot find element with id "+m[1])}}else{s.error("cannot find element id for inline content")}}else{if(item.player=="swf"||item.player=="flv"){var version=(item.options&&item.options.flashversion)||s.options.flashversion;if(!swfobject.hasflashplayerversion(version)){item.width=310;item.height=177}}}}if(remove){s.gallery.splice(i,1);if(i0?i-1:i}}--i}}if(s.gallery.length){if(!active){if(typeof s.options.onopen=="function"&&s.options.onopen(obj)===false){return}s.skin.onopen(obj,loadcontent)}else{loadcontent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new date().gettime();slide_delay=math.max(0,slide_delay-(time-slide_start));if(slide_delay){cleartimeout(slide_timer);slide_timer="paused";if(s.skin.onpause){s.skin.onpause()}}},play:function(){if(!s.hasnext()){return}if(!slide_delay){slide_delay=s.options.slideshowdelay*1000}if(slide_delay){slide_start=new date().gettime();slide_timer=settimeout(function(){slide_delay=slide_start=0;s.next()},slide_delay);if(s.skin.onplay){s.skin.onplay()}}},previous:function(){s.change(s.current-1)},setdimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseint(height),w=width=parseint(width),pad=parseint(s.options.viewportpadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&s.options.handleoversize=="resize"){if(change_h>change_w){w=math.round((width/height)*h)}else{if(change_w>change_h){h=math.round((height/width)*w)}}resize_w=w;resize_h=h}s.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w}},setup:function(links,opts){each(s.findlinks(links),function(link){s.addcache(link,opts)})},teardown:function(links){each(s.findlinks(links),s.removecache)},findlinks:function(links){if(!links){var links=[],rel;each(document.getelementsbytagname("a"),function(a){rel=a.getattribute("rel");if(rel&&s.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.sizzle){if(typeof links=="string"){links=sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodetype){links=sizzle(links[0],links[1])}}}}else{links=[links]}}return links},incache:function(link){return typeof link[s.expando]=="number"&&s.cache[link[s.expando]]},addcache:function(link,opts){if(!s.incache(link)){link[s.expando]=s.cache.length;s.lib.addevent(link,"click",handleclick)}s.cache[link[s.expando]]=s.buildcacheobj(link,opts)},removecache:function(link){s.lib.removeevent(link,"click",handleclick);s.cache[link[s.expando]]=null;delete link[s.expando]},clearcache:function(){each(s.cache,function(obj){s.removecache(obj.link)});s.cache=[]},buildcacheobj:function(link,opts){var obj={link:link,title:link.getattribute("title"),options:apply({},opts||{}),content:link.href};if(opts){each(["player","title","height","width","gallery"],function(option){if(typeof obj.options[option]!="undefined"){obj[option]=obj.options[option];delete obj.options[option]}})}if(!obj.player){obj.player=s.getplayer(obj.content)}var rel=link.getattribute("rel");if(rel){var match=rel.match(s.regex.gallery);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(parameter){match=parameter.match(s.regex.param);if(match){if(match[1]=="options"){eval("apply(obj.options,"+match[2]+")")}else{obj[match[1]]=match[2]}}})}return obj},getplayer:function(content){var r=s.regex,p=s.plugins,m=content.match(r.domain),same_domain=m&&document.domain==m[1];if(content.indexof("#")>-1&&same_domain){return"inline"}var q=content.indexof("?");if(q>-1){content=content.substring(0,q)}if(r.img.test(content)){return"img"}if(r.swf.test(content)){return p.fla?"swf":"unsupported-swf"}if(r.flv.test(content)){return p.fla?"flv":"unsupported-flv"}if(r.qt.test(content)){return p.qt?"qt":"unsupported-qt"}if(r.wmp.test(content)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(s.client.ismac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(r.qtwmp.test(content)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return s.client.ismac?"unsupported-qt":"unsupported-qtwmp"}return"iframe"}},u=s.util={animate:function(el,p,to,d,cb){var from=parsefloat(s.lib.getstyle(el,p));if(isnan(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){u.setopacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!s.options.animate)||(op&&!s.options.animatefade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new date().gettime(),ease=s.options.ease,end=begin+d,time,timer=setinterval(function(){time=new date().gettime();if(time>=end){clearinterval(timer);fn(1);if(cb){cb()}}else{fn(ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearopacity:function(el){var s=el.style;if(window.activexobject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i-1;s.plugins={fla:names.indexof("shockwave flash")>-1,qt:names.indexof("quicktime")>-1,wmp:!f4m&&names.indexof("windows media")>-1,f4m:f4m}}else{function detectplugin(n){try{var axo=new activexobject(n)}catch(e){}return !!axo}s.plugins={fla:detectplugin("shockwaveflash.shockwaveflash"),qt:detectplugin("quicktime.quicktime"),wmp:detectplugin("wmplayer.ocx"),f4m:false}}function waitdom(cb){if(document.addeventlistener){document.addeventlistener("domcontentloaded",function(){document.removeeventlistener("domcontentloaded",arguments.callee,false);cb()},false)}else{if(document.attachevent){document.attachevent("onreadystatechange",function(){if(document.readystate==="complete"){document.detachevent("onreadystatechange",arguments.callee);cb()}});if(document.documentelement.doscroll&&window==window.top){(function(){if(s.ready){return}try{document.documentelement.doscroll("left")}catch(error){settimeout(arguments.callee,0);return}cb()})()}}}if(typeof window.onload=="function"){var oldonload=window.onload;window.onload=function(){oldonload();cb()}}else{window.onload=cb}}function waitlibs(){if(s.lib&&s.lang){s.load()}else{settimeout(waitlibs,0)}}function handleclick(e){var link;if(u.islink(this)){link=this}else{link=s.lib.gettarget(e);while(!u.islink(link)&&link.parentnode){link=link.parentnode}}s.lib.preventdefault(e);if(link){s.open(link);if(s.gallery.length){s.lib.preventdefault(e)}}}function listenkeys(on){if(!s.options.enablekeys){return}s.lib[(on?"add":"remove")+"event"](document,"keydown",handlekey)}function handlekey(e){var code=s.lib.keycode(e),handler;switch(code){case 81:case 88:case 27:handler=s.close;break;case 37:handler=s.previous;break;case 39:handler=s.next;break;case 32:handler=typeof slide_timer=="number"?s.pause:s.play}if(handler){s.lib.preventdefault(e);handler()}}function loadcontent(){var obj=s.getcurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof s[p]!="function"){s.error("unknown player: "+p)}var change=false;if(s.content){s.content.remove();change=true;s.revertoptions();if(obj.options){s.applyoptions(obj.options)}}u.removechildren(s.skin.bodyel());s.content=new s[p](obj);listenkeys(false);s.skin.onload(s.content,change,function(){if(!s.content){return}if(typeof s.content.ready!="undefined"){var id=setinterval(function(){if(s.content){if(s.content.ready){clearinterval(id);id=null;s.skin.onready(contentready)}}else{clearinterval(id);id=null}},100)}else{s.skin.onready(contentready)}});if(s.gallery.length>1){var next=s.gallery[s.current+1]||s.gallery[0];if(next.player=="img"){var a=new image();a.src=next.content}var prev=s.gallery[s.current-1]||s.gallery[s.gallery.length-1];if(prev.player=="img"){var b=new image();b.src=prev.content}}}function contentready(){if(!s.content){return}s.content.append(s.skin.bodyel(),content_id,s.dimensions);s.skin.onfinish(finishcontent)}function finishcontent(){if(!s.content){return}if(s.content.onload){s.content.onload()}if(s.options.onfinish){s.options.onfinish()}if(!s.ispaused()){s.play()}listenkeys(true)}window.shadowbox=s})();(function(){var g=shadowbox,f=g.util,q=false,b=[],m=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],o={markup:'',options:{animsequence:"sync",autodimensions:false,counterlimit:10,countertype:"default",displaycounter:true,displaynav:true,fadeduration:0.35,initialheight:160,initialwidth:320,modal:false,overlaycolor:"#000",overlayopacity:0.8,resizeduration:0.35,showoverlay:true,troubleelements:["select","object","embed","canvas"]},init:function(){var s=o.markup.replace(/\{(\w+)\}/g,function(w,x){return g.lang[x]});g.lib.append(document.body,s);if(g.client.isie6){f.get("sb-body").style.zoom=1;var u,r,t=/url\("(.*\.png)"\)/;f.each(m,function(w){u=f.get(w);if(u){r=g.lib.getstyle(u,"backgroundimage").match(t);if(r){u.style.backgroundimage="none";u.style.filter="progid:dximagetransform.microsoft.alphaimageloader(enabled=true,src="+r[1]+",sizingmethod=scale);"}}})}var v;g.lib.addevent(window,"resize",function(){if(v){cleartimeout(v);v=null}if(g.isactive()){v=settimeout(function(){o.onwindowresize();var w=g.content;if(w&&w.onwindowresize){w.onwindowresize()}},50)}})},bodyel:function(){return f.get("sb-body-inner")},onopen:function(u,r){e(false);var t=g.options.autodimensions&&"height" in u?u.height:g.options.initialheight,s=g.options.autodimensions&&"width" in u?u.width:g.options.initialwidth;f.get("sb-container").style.display="block";var v=p(t,s);d(v.inner_h,v.top,false);h(v.width,v.left,false);i(r)},onload:function(s,t,r){k(true);j(t,function(){if(!s){return}if(!t){f.get("sb-wrapper").style.display=""}r()})},onready:function(r){var t=g.content;if(!t){return}var s=p(t.height,t.width,t.resizable);o.resizecontent(s.inner_h,s.width,s.top,s.left,true,function(){l(r)})},onfinish:function(r){k(false,r)},onclose:function(){i();e(true)},onplay:function(){c("play",false);c("pause",true)},onpause:function(){c("pause",false);c("play",true)},onwindowresize:function(){var t=g.content;if(!t){return}var s=p(t.height,t.width,t.resizable);h(s.width,s.left,false);d(s.inner_h,s.top,false);var r=f.get(g.contentid());if(r){if(t.resizable&&g.options.handleoversize=="resize"){r.height=s.resize_h;r.width=s.resize_w}}},resizecontent:function(s,t,w,v,u,r){var y=g.content;if(!y){return}var x=p(y.height,y.width,y.resizable);switch(g.options.animsequence){case"hw":d(x.inner_h,x.top,u,function(){h(x.width,x.left,u,r)});break;case"wh":h(x.width,x.left,u,function(){d(x.inner_h,x.top,u,r)});break;default:h(x.width,x.left,u);d(x.inner_h,x.top,u,r)}}};function n(){f.get("sb-container").style.top=document.documentelement.scrolltop+"px"}function e(r){if(r){f.each(b,function(s){s[0].style.visibility=s[1]||""})}else{b=[];f.each(g.options.troubleelements,function(s){f.each(document.getelementsbytagname(s),function(t){b.push([t,t.style.visibility]);t.style.visibility="hidden"})})}}function i(r){var s=f.get("sb-overlay"),t=f.get("sb-container"),v=f.get("sb-wrapper");if(r){if(g.client.isie6){n();g.lib.addevent(window,"scroll",n)}if(g.options.showoverlay){q=true;s.style.backgroundcolor=g.options.overlaycolor;f.setopacity(s,0);if(!g.options.modal){g.lib.addevent(s,"click",g.close)}v.style.display="none"}t.style.visibility="visible";if(q){var u=parsefloat(g.options.overlayopacity);f.animate(s,"opacity",u,g.options.fadeduration,r)}else{r()}}else{if(g.client.isie6){g.lib.removeevent(window,"scroll",n)}g.lib.removeevent(s,"click",g.close);if(q){v.style.display="none";f.animate(s,"opacity",0,g.options.fadeduration,function(){t.style.display="";v.style.display="";f.clearopacity(s)})}else{t.style.visibility="hidden"}}}function c(t,r){var s=f.get("sb-nav-"+t);if(s){s.style.display=r?"":"none"}}function k(s,r){var u=f.get("sb-loading"),w=g.getcurrent().player,v=(w=="img"||w=="html");if(s){function t(){f.clearopacity(u);if(r){r()}}f.setopacity(u,0);u.style.display="";if(v){f.animate(u,"opacity",1,g.options.fadeduration,t)}else{t()}}else{function t(){u.style.display="none";f.clearopacity(u);if(r){r()}}if(v){f.animate(u,"opacity",0,g.options.fadeduration,t)}else{t()}}}function a(u){var z=g.getcurrent();f.get("sb-title-inner").innerhtml=z.title||"";var c,t,x,d,s;if(g.options.displaynav){c=true;var b=g.gallery.length;if(b>1){if(g.options.continuous){t=s=true}else{t=(b-1)>g.current;s=g.current>0}}if(g.options.slideshowdelay>0&&g.hasnext()){d=!g.ispaused();x=!d}}else{c=t=x=d=s=false}c("close",c);c("next",t);c("play",x);c("pause",d);c("previous",s);var r="";if(g.options.displaycounter&&g.gallery.length>1){var b=g.gallery.length;if(g.options.countertype=="skip"){var y=0,w=b,v=parseint(g.options.counterlimit)||0;if(v2){var a=math.floor(v/2);y=g.current-a;if(y<0){y+=b}w=g.current+(v-a);if(w>b){w-=b}}while(y!=w){if(y==b){y=0}r+='"}}else{var r=(g.current+1)+" "+g.lang.of+" "+b}}f.get("sb-counter").innerhtml=r;u()}function j(u,s){var y=f.get("sb-wrapper"),b=f.get("sb-title"),v=f.get("sb-info"),r=f.get("sb-title-inner"),z=f.get("sb-info-inner"),a=parseint(g.lib.getstyle(r,"height"))||0,x=parseint(g.lib.getstyle(z,"height"))||0;var w=function(){r.style.visibility=z.style.visibility="hidden";a(s)};if(u){f.animate(b,"height",0,0.35);f.animate(v,"height",0,0.35);f.animate(y,"paddingtop",a,0.35);f.animate(y,"paddingbottom",x,0.35,w)}else{b.style.height=v.style.height="0px";y.style.paddingtop=a+"px";y.style.paddingbottom=x+"px";w()}}function l(u){var s=f.get("sb-wrapper"),w=f.get("sb-title"),v=f.get("sb-info"),z=f.get("sb-title-inner"),y=f.get("sb-info-inner"),x=parseint(g.lib.getstyle(z,"height"))||0,r=parseint(g.lib.getstyle(y,"height"))||0;z.style.visibility=y.style.visibility="";if(z.innerhtml!=""){f.animate(w,"height",x,0.35);f.animate(s,"paddingtop",0,0.35)}f.animate(v,"height",r,0.35);f.animate(s,"paddingbottom",0,0.35,u)}function d(u,z,y,r){var a=f.get("sb-body"),x=f.get("sb-wrapper"),w=parseint(u),v=parseint(z);if(y){f.animate(a,"height",w,g.options.resizeduration);f.animate(x,"top",v,g.options.resizeduration,r)}else{a.style.height=w+"px";x.style.top=v+"px";if(r){r()}}}function h(x,z,y,r){var v=f.get("sb-wrapper"),u=parseint(x),t=parseint(z);if(y){f.animate(v,"width",u,g.options.resizeduration);f.animate(v,"left",t,g.options.resizeduration,r)}else{v.style.width=u+"px";v.style.left=t+"px";if(r){r()}}}function p(r,u,t){var s=f.get("sb-body-inner");sw=f.get("sb-wrapper"),so=f.get("sb-overlay"),tb=sw.offsetheight-s.offsetheight,lr=sw.offsetwidth-s.offsetwidth,max_h=so.offsetheight,max_w=so.offsetwidth;g.setdimensions(r,u,max_h,max_w,tb,lr,t);return g.dimensions}g.skin=o})();