/* shadowbox 1.0 with mootools adapter */ if(typeof MooTools=="undefined"){throw"Unable to load Shadowbox, MooTools library not found."}var Shadowbox={};lib={getStyle:function(B,A){return $(B).getStyle(A)},setStyle:function(D,C,E){D=$(D);if(typeof C!="object"){var A={};A[C]=E;C=A}for(var B in C){setstyle(B,C[B])}},get:function(A){return $(A)},remove:function(A){removechild(A)},getTarget:function(A){return target||{}},preventDefault:function(A){new Event(A).preventDefault()},addEvent:function(C,A,B){$(C).addEvent(A,B)},removeEvent:function(C,A,B){$(C).removeEvent(A,B)},animate:function(B,F,E,H){var A={duration:(E*1000)};if(typeof H=="function"){oncomplete=H}var C=new styles(B,A);var G={};for(var D in F){G[D]=String(F[D].to);if(D!="opacity"){G[D]+="px"}}start(G)}};if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox, no base library adapter found."}(function(){var version="1.0";var options={assetURL:"",loadingImage:"images/gif",animate:true,animSequence:"wh",flvPlayer:"swf",overlayColor:"#000",overlayOpacity:0.85,overlayBgImage:"images/png",listenOverlay:true,autoplayMovies:true,showMovieControls:true,resizeDuration:0.35,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:"default",viewportPadding:20,handleLgImages:"resize",initialHeight:160,initialWidth:320,enableKeys:true,keysClose:["c","q",27],keysNext:["n",39],keysPrev:["p",37],onOpen:null,onFinish:null,onChange:null,onClose:null,handleUnsupported:"link",skipSetup:false,text:{cancel:"Cancel",loading:"loading",close:'Close',next:'Next',prev:'Previous',errors:{single:'You must install the {1} browser plugin to view this content.',shared:'You must install both the {1} and {3} browser plugins to view this content.',either:'You must install either the {1} or the {3} browser plugin to view this content.'}},errors:{fla:{name:"Flash",url:"#"},qt:{name:"QuickTime",url:"#"},wmp:{name:"Windows Media Player",url:"#"},f4m:{name:"Flip4Mac",url:"#"}},skin:{main:'

',loading:'{1}{2}',counter:'
{0}
',close:'
{0}
',next:'
{0}
',prev:'
{0}
'},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"]}};var default_options=null;var SL=lib;var RE={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};var cache=[];var current_gallery;var current;var optimal_height=initialheight;var optimal_width=initialwidth;var current_height=0;var current_width=0;var preloader;var initialized=false;var activated=false;var drag;var draggable;var overlay_img_needed;var ua=tolowercase();var isStrict=compatmode=="CSS1Compat",isOpera=indexof("opera")>-1,isIE=indexof("msie")>-1,isIE7=indexof("msie 7")>-1,isBorderBox=isIE&&!isStrict,isSafari=(/webkit|khtml/).test(ua),isSafari3=isSafari&&!!(evaluate),isGecko=!isSafari&&indexof("gecko")>-1,isWindows=(indexof("windows")!=-1||indexof("win32")!=-1),isMac=(indexof("macintosh")!=-1||indexof("mac os x")!=-1),isLinux=(indexof("linux")!=-1);var absolute_pos=isIE&&!isIE7;var plugins=null;if(plugins&&length){var detectPlugin=function(plugin_name){var detected=false;for(var i=0,len=length;i-1){detected=true;break}}return detected};var f4m=detectPlugin("Flip4Mac");var plugins={fla:detectPlugin("Shockwave Flash"),qt:detectPlugin("QuickTime"),wmp:!f4m&&detectPlugin("Windows Media"),f4m:f4m}}else{var detectPlugin=function(plugin_name){var detected=false;try{var axo=new ActiveXObject(plugin_name);if(axo){detected=true}}catch(e){}return detected};var plugins={fla:detectPlugin("shockwaveflash"),qt:detectPlugin("quicktime"),wmp:detectPlugin("ocx"),f4m:false}}var apply=function(o,e){for(var p in e){o[p]=e[p]}return o};var isLink=function(el){return typeof tagname=="string"&&(touppercase()=="A"||touppercase()=="AREA")};getviewportheight=function(){var height=innerheight;var mode=compatmode;if((mode||isIE)&&!isOpera){height=isStrict?clientheight:clientheight}return height};getviewportwidth=function(){var width=innerwidth;var mode=compatmode;if(mode||isIE){width=isStrict?clientwidth:clientwidth}return width};getdocumentheight=function(){var scrollHeight=isStrict?scrollheight:scrollheight;return max(scrollHeight,getviewportheight())};getdocumentwidth=function(){var scrollWidth=isStrict?scrollwidth:scrollwidth;return max(scrollWidth,getviewportwidth())};var clearOpacity=function(el){if(isIE){if(typeof filter=="string"&&(/alpha/i).test(filter)){filter=""}}else{opacity="";style["-moz-opacity"]="";style["-khtml-opacity"]=""}};var fadeIn=function(el,endingOpacity,duration,callback){if(animate){setstyle(el,"opacity",0);visibility="visible";animate(el,{opacity:{to:endingOpacity}},duration,function(){if(endingOpacity==1){clearOpacity(el)}if(typeof callback=="function"){callback()}})}else{if(endingOpacity==1){clearOpacity(el)}else{setstyle(el,"opacity",endingOpacity)}visibility="visible";if(typeof callback=="function"){callback()}}};var fadeOut=function(el,duration,callback){var cb=function(){visibility="hidden";clearOpacity(el);if(typeof callback=="function"){callback()}};if(animate){animate(el,{opacity:{to:0}},duration,cb)}else{cb()}};var appendHTML=function(el,html){el=get(el);if(insertadjacenthtml){insertadjacenthtml("BeforeEnd",html);return lastchild}if(lastchild){var range=createrange();setstartafter(lastchild);var frag=createcontextualfragment(html);appendchild(frag);return lastchild}else{innerhtml=html;return lastchild}};var overwriteHTML=function(el,html){el=get(el);innerhtml=html;return firstchild};var getComputedHeight=function(el){var h=max(offsetheight,clientheight);if(!h){h=parseInt(getstyle(el,"height"),10)||0;if(!isBorderBox){h+=parseInt(getstyle(el,"padding-top"),10)+parseInt(getstyle(el,"padding-bottom"),10)+parseInt(getstyle(el,"border-top-width"),10)+parseInt(getstyle(el,"border-bottom-width"),10)}}return h};var getComputedWidth=function(el){var w=max(offsetwidth,clientwidth);if(!w){w=parseInt(getstyle(el,"width"),10)||0;if(!isBorderBox){w+=parseInt(getstyle(el,"padding-left"),10)+parseInt(getstyle(el,"padding-right"),10)+parseInt(getstyle(el,"border-left-width"),10)+parseInt(getstyle(el,"border-right-width"),10)}}return w};var getPlayerType=function(url){if(test(url)){return"img"}var match=match(domain);var this_domain=match?domain==match[1]:false;if(indexof("#")>-1&&this_domain){return"inline"}var q_index=indexof("?");if(q_index>-1){url=substring(0,q_index)}if(test(url)){return fla?"swf":"unsupported-swf"}if(test(url)){return fla?"flv":"unsupported-flv"}if(test(url)){return qt?"qt":"unsupported-qt"}if(test(url)){if(wmp){return"wmp"}else{if(plugins.f4m){return"qt"}else{return isMac?(qt?"unsupported-f4m":"unsupported-qtf4m"):"unsupported-wmp"}}}else{if(test(url)){if(qt){return"qt"}else{if(wmp){return"wmp"}else{return isMac?"unsupported-qt":"unsupported-qtwmp"}}}else{if(!this_domain||test(url)){return"iframe"}}}return"unsupported"};var handleClick=function(ev){var link;if(isLink(this)){link=this}else{link=gettarget(ev);while(!isLink(link)&&parentnode){link=parentnode}}open(link);if(length){preventdefault(ev)}};var setupGallery=function(obj){var copy=apply({},obj);if(!gallery){current_gallery=[copy];current=0}else{current_gallery=[];var index,ci;for(var i=0,len=length;i'+m+""})}else{r=true}}else{if(current_gallery[i].type=="inline"){var match=exec(current_gallery[i].content);if(match){var el;if(el=get(match[1])){current_gallery[i].content=innerhtml}else{throw"No element found with id "+match[1]}}else{throw"No element id found for inline content"}}}}if(r){splice(i,1);if(i1){if(continuous){appendHTML(tool_i,format(next,next));appendHTML(tool_i,format(prev,prev))}else{if((length-1)>current){appendHTML(tool_i,format(next,next))}if(current>0){appendHTML(tool_i,format(prev,prev))}}}}if(length>1&&displaycounter){var counter="";if(countertype=="skip"){for(var i=0,len=length;i"+(i+1)+""}}else{counter=(current+1)+" of "+length}appendHTML(tool_i,format(counter,counter))}};var hideBars=function(callback){var title_m=getComputedHeight(get("shadowbox_title"));var tool_m=0-getComputedHeight(get("shadowbox_toolbar"));var title_i=get("shadowbox_title_inner");var tool_i=get("shadowbox_toolbar_inner");if(animate&&callback){animate(title_i,{marginTop:{to:title_m}},0.2);animate(tool_i,{marginTop:{to:tool_m}},0.2,callback)}else{setstyle(title_i,"marginTop",title_m+"px");setstyle(tool_i,"marginTop",tool_m+"px")}};var showBars=function(callback){var title_i=get("shadowbox_title_inner");if(animate){if(innerhtml!=""){animate(title_i,{marginTop:{to:0}},0.35)}animate(get("shadowbox_toolbar_inner"),{marginTop:{to:0}},0.35,callback)}else{if(innerhtml!=""){setstyle(title_i,"margin-top","0px")}setstyle(get("shadowbox_toolbar_inner"),"margin-top","0px");callback()}};var resetDrag=function(){drag={x:0,y:0,start_x:null,start_y:null}};var toggleDrag=function(on){if(on){resetDrag();var styles=["position:absolute","cursor:"+(isGecko?"-moz-grab":"move")];push(isIE?"background-color:#fff;filter:alpha(opacity=0)":"background-color:transparent");appendHTML("shadowbox_body_inner",'
');addevent(get("shadowbox_drag_layer"),"mousedown",listenDrag)}else{var d=get("shadowbox_drag_layer");if(d){removeevent(d,"mousedown",listenDrag);remove(d)}}};var listenDrag=function(ev){start_x=clientx;start_y=clienty;draggable=get("shadowbox_content");addevent(document,"mousemove",positionDrag);addevent(document,"mouseup",unlistenDrag);if(isGecko){setstyle(get("shadowbox_drag_layer"),"cursor","-moz-grabbing")}};var unlistenDrag=function(){removeevent(document,"mousemove",positionDrag);removeevent(document,"mouseup",unlistenDrag);if(isGecko){setstyle(get("shadowbox_drag_layer"),"cursor","-moz-grab")}};var positionDrag=function(ev){var move_y=start_y;start_y=start_y+move_y;drag.y=max(min(0,drag.y+move_y),current_height-optimal_height);setstyle(draggable,"top",drag.y+"px");var move_x=start_x;start_x=start_x+move_x;drag.x=max(min(0,drag.x+move_x),current_width-optimal_width);setstyle(draggable,"left",drag.x+"px")};var loadContent=function(){var obj=current_gallery[current];if(!obj){return }buildBars();switch(type){case"img":preloader=new Image();onload=function(){var h=height?parseInt(height,10):height;var w=width?parseInt(width,10):width;resizeContent(h,w,function(dims){showBars(function(){setContent({tag:"img",height:dims.i_height,width:dims.i_width,src:content,style:"position:absolute"});if(enabledrag&&handlelgimages=="drag"){toggleDrag(true);setstyle(get("shadowbox_drag_layer"),{height:dims.i_height+"px",width:dims.i_width+"px"})}finishContent()})});onload=function(){}};src=content;break;case"swf":case"flv":case"qt":case"wmp":var markup=moviemarkup(obj);resizeContent(height,width,function(){showBars(function(){setContent(markup);finishContent()})});break;case"iframe":var h=height?parseInt(height,10):getviewportheight();var w=width?parseInt(width,10):getviewportwidth();var content={tag:"iframe",name:"shadowbox_content",height:"100%",width:"100%",frameborder:"0",marginwidth:"0",marginheight:"0",scrolling:"auto"};resizeContent(h,w,function(dims){showBars(function(){setContent(content);var win=(isIE)?get("shadowbox_content").contentWindow:shadowbox_content;location=content;finishContent()})});break;case"html":case"inline":var h=height?parseInt(height,10):getviewportheight();var w=width?parseInt(width,10):getviewportwidth();var content={tag:"div",cls:"html",html:content};resizeContent(h,w,function(){showBars(function(){setContent(content);finishContent()})});break;default:throw"Shadowbox cannot open content of type "+type}if(length>0){var next=current_gallery[current+1];if(!next){next=current_gallery[0]}if(type=="img"){var preload_next=new Image();src=href}var prev=current_gallery[current-1];if(!prev){prev=current_gallery[length-1]}if(type=="img"){var preload_prev=new Image();src=href}}};var setContent=function(obj){var id="shadowbox_content";var content=get(id);if(content){switch(touppercase()){case"OBJECT":var link=current_gallery[(obj?current-1:current)];if(type=="wmp"&&isIE){try{stop();url="wmv";shadowbox_content=function(){}}catch(e){}}else{if(type=="qt"&&isSafari){try{stop()}catch(e){}innerhtml=""}}setTimeout(function(){remove(content)},10);break;case"IFRAME":remove(content);if(isGecko){delete frames[id]}break;default:remove(content)}}if(obj){if(!id){id=id}return appendHTML("shadowbox_body_inner",createhtml(obj))}return null};var finishContent=function(){var obj=current_gallery[current];if(!obj){return }hideLoading(function(){listenKeyboard(true);if(onfinish&&typeof onfinish=="function"){onfinish(obj)}})};var resizeContent=function(height,width,callback){optimal_height=height;optimal_width=width;var resizable=test(current_gallery[current].type);var dims=getDimensions(optimal_height,optimal_width,resizable);if(callback){var cb=function(){callback(dims)};switch(animsequence){case"hw":adjustHeight(height,top,true,function(){adjustWidth(width,true,cb)});break;case"wh":adjustWidth(width,true,function(){adjustHeight(height,top,true,cb)});break;default:adjustWidth(width,true);adjustHeight(height,top,true,cb)}}else{adjustWidth(width,false);adjustHeight(height,top,false);if(handlelgimages=="resize"&&resizable){var content=get("shadowbox_content");if(content){height=dims.i_height;width=dims.i_width}}}};var getDimensions=function(o_height,o_width,resizable){if(typeof resizable=="undefined"){resizable=false}var height=o_height=parseInt(o_height);var width=o_width=parseInt(o_width);var shadowbox_b=get("shadowbox_body");var view_height=getviewportheight();var extra_height=parseInt(getstyle(shadowbox_b,"border-top-width"),10)+parseInt(getstyle(shadowbox_b,"border-bottom-width"),10)+parseInt(getstyle(shadowbox_b,"margin-top"),10)+parseInt(getstyle(shadowbox_b,"margin-bottom"),10)+getComputedHeight(get("shadowbox_title"))+getComputedHeight(get("shadowbox_toolbar"))+(2*viewportpadding);if((height+extra_height)>=view_height){height=view_height-extra_height}var view_width=getviewportwidth();var extra_body_width=parseInt(getstyle(shadowbox_b,"border-left-width"),10)+parseInt(getstyle(shadowbox_b,"border-right-width"),10)+parseInt(getstyle(shadowbox_b,"margin-left"),10)+parseInt(getstyle(shadowbox_b,"margin-right"),10);var extra_width=extra_body_width+(2*viewportpadding);if((width+extra_width)>=view_width){width=view_width-extra_width}var enableDrag=false;var i_height=o_height;var i_width=o_width;var handle=handlelgimages;if(resizable&&(handle=="resize"||handle=="drag")){var change_h=(o_height-height)/o_height;var change_w=(o_width-width)/o_width;if(handle=="resize"){if(change_h>change_w){width=round((o_width/o_height)*height)}else{if(change_w>change_h){height=round((o_height/o_width)*width)}}i_width=width;i_height=height}else{var link=current_gallery[current];if(link){enableDrag=type=="img"&&(change_h>0||change_w>0)}}}return{height:height,width:width+extra_body_width,i_height:i_height,i_width:i_width,top:((view_height-(height+extra_height))/2)+viewportpadding,enableDrag:enableDrag}};var centerVertically=function(){var shadowbox=get("shadowbox");var scroll=scrolltop;var s_top=scroll+round((getviewportheight()-(offsetheight||0))/2);setstyle(shadowbox,"top",s_top+"px")};var adjustHeight=function(height,top,animate,callback){height=parseInt(height);current_height=height;var sbi=get("shadowbox_body_inner");if(animate&&animate){animate(sbi,{height:{to:height}},resizeduration,callback)}else{setstyle(sbi,"height",height+"px");if(typeof callback=="function"){callback()}}if(absolute_pos){centerVertically();addevent(window,"scroll",centerVertically);top+=scrolltop}var shadowbox=get("shadowbox");if(animate&&animate){animate(shadowbox,{top:{to:top}},resizeduration)}else{setstyle(shadowbox,"top",top+"px")}};var adjustWidth=function(width,animate,callback){width=parseInt(width);current_width=width;var shadowbox=get("shadowbox");if(animate&&animate){animate(shadowbox,{width:{to:width}},resizeduration,callback)}else{setstyle(shadowbox,"width",width+"px");if(typeof callback=="function"){callback()}}};var listenKeyboard=function(on){if(!enablekeys){return }if(on){onkeydown=handleKey}else{onkeydown=""}};var assertKey=function(valid,key,code){return(indexof(key)!=-1||indexof(code)!=-1)};var handleKey=function(e){var code=e?which:keycode;var key=fromcharcode(code).toLowerCase();if(assertKey(keysclose,key,code)){close()}else{if(assertKey(keysprev,key,code)){previous()}else{if(assertKey(keysnext,key,code)){next()}}}};var toggleTroubleElements=function(on){var vis=(on?"visible":"hidden");var selects=getelementsbytagname("select");for(i=0,len=length;i\n"}else{html+=">\n";var cn=children;if(cn){for(var i=0,len=length;i\n"}return html};getplugins=function(){return plugins};getoptions=function(){return options};getcurrent=function(){return current_gallery[current]};getversion=function(){return version}})();indexof=indexof||function(C){for(var B=0,A=length;B