/**
 * Version: 1.00
 * UI & logic & MooTools 1.4 changes: Danilo Cuculić
 * TinyTab v0.1.1 (Danillo César de O. Melo)
 * Loop v1.3 (Ryan Florence)
 * Slideshow v2.1.0 (Ryan Florence)
 * MediaboxAdvanced v1.5.4 (John Einselen http://iaian7.com/webcode/mediaboxAdvanced)
 **/

var Mediabox;(function(){var y,H,z,r,w,l,E,i,k,h,K,v,q,x=new Image(),U=new Image(),R,a,O,b,T,D,N,V,S,d,B,Q,F,u,A,m,g="none",e,c="mediaBox",j,C;window.addEvent("domready",function(){document.id(document.body).adopt($$([R=new Element("div",{id:"mbOverlay"}).addEvent("click",P),a=new Element("div",{id:"mbCenter"})]).setStyle("display","none"));container=new Element("div",{id:"mbContainer"}).inject(a,"inside");O=new Element("div",{id:"mbMedia"}).inject(container,"inside");b=new Element("div",{id:"mbBottom"}).inject(a,"inside").adopt(closeLink=new Element("a",{id:"mbCloseLink",href:"#"}).addEvent("click",P),d=new Element("a",{id:"mbNextLink",href:"#"}).addEvent("click",f),S=new Element("a",{id:"mbPrevLink",href:"#"}).addEvent("click",L),D=new Element("div",{id:"mbTitle"}),V=new Element("div",{id:"mbNumber"}),N=new Element("div",{id:"mbCaption"}));v={overlay:new Fx.Tween(R,{property:"opacity",duration:360}).set(0),media:new Fx.Tween(O,{property:"opacity",duration:360,onComplete:I}),bottom:new Fx.Tween(b,{property:"opacity",duration:240}).set(0)};});Mediabox={close:function(){P();},recenter:function(){if(a&&!Browser.Platform.ios){i=window.getScrollLeft()+(window.getWidth()/2);if(!Browser.ie){a.setStyles({left:i,marginLeft:-(A/2)-j});}}},open:function(Y,X,W){y={buttonText:["<big>&laquo;</big>","<big>&raquo;</big>","<big>&times;</big>"],counterText:"({x} od {y})",linkText:'<a href="{x}" target="_new">{x}</a><br/>open in a new tab</div>',flashText:'<b>Error</b><br/>Adobe Flash is either not installed or not up to date, please visit <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" title="Get Flash" target="_new">Adobe.com</a> to download the free player.',center:true,loop:false,keyboard:true,keyboardAlpha:false,keyboardStop:false,overlayOpacity:0.75,resizeOpening:true,resizeDuration:240,initialWidth:320,initialHeight:180,defaultWidth:640,defaultHeight:360,showCaption:true,showCounter:true,countBack:false,clickBlock:true,iOShtml:true,imgBackground:false,imgPadding:100,overflow:"auto",inlineClone:false,html5:"true",scriptaccess:"true",fullscreen:"true",fullscreenNum:"1",autoplay:"true",autoplayNum:"1",autoplayYes:"yes",volume:"100",medialoop:"true",bgcolor:"#000000",wmode:"transparent",playerpath:"files/NonverBlaster.swf",showTimecode:"false",controlColor:"0xFFFFFF",controlBackColor:"0x0000000",playerBackColor:"",wmodeNB:"transparent",controller:"true",flInfo:"true",revverID:"187866",revverFullscreen:"true",revverBack:"000000",revverFront:"ffffff",revverGrad:"000000",usViewers:"true",ytBorder:"0",ytColor1:"000000",ytColor2:"333333",ytRel:"0",ytInfo:"1",ytSearch:"0",vuPlayer:"basic",vmTitle:"1",vmByline:"1",vmPortrait:"1",vmColor:"ffffff"};S.set("html",y.buttonText[0]);d.set("html",y.buttonText[1]);closeLink.set("html",y.buttonText[2]);if(Browser.firefox2){y.overlayOpacity=1;R.className="mbOverlayOpaque";}if(Browser.Platform.ios){y.keyboard=false;y.resizeOpening=false;R.className="mbMobile";b.className="mbMobile";M();}if(Browser.ie6){y.resizeOpening=false;R.className="mbOverlayAbsolute";M();}if(typeof Y=="string"){Y=[[Y,X,W]];X=0;}H=Y;y.loop=y.loop&&(H.length>1);o();p(true);l=window.getScrollTop()+(window.getHeight()/2);i=window.getScrollLeft()+(window.getWidth()/2);j=a.getStyle("padding-left").toInt()+O.getStyle("margin-left").toInt()+O.getStyle("padding-left").toInt();C=b.getStyle("margin-left").toInt()+b.getStyle("padding-left").toInt()+b.getStyle("margin-right").toInt()+b.getStyle("padding-right").toInt();a.setStyles({top:l,left:i,width:y.initialWidth,height:y.initialHeight,marginTop:-(y.initialHeight/2)-j,marginLeft:-(y.initialWidth/2)-j,display:""});v.resize=new Fx.Morph(a,{duration:y.resizeDuration,onComplete:J});v.overlay.start(y.overlayOpacity);return G(X);}};Element.implement({mediabox:function(W,X){$$(this).mediabox(W,X);return this;}});Elements.implement({mediabox:function(W,Z,Y){Z=Z||function(aa){u=aa.rel.split(/[\[\]]/);u=u[1];return[aa.get("href"),aa.title,u];};Y=Y||function(){return true;};var X=this;X.addEvent("contextmenu",function(aa){if(this.toString().match(/\.gif|\.jpg|\.jpeg|\.png/i)){aa.stop();}});X.removeEvents("click").addEvent("click",function(){var ab=X.filter(Y,this);var ac=[];var aa=[];ab.each(function(ae,ad){if(aa.indexOf(ae.toString())<0){ac.include(ab[ad]);aa.include(ab[ad].toString());}});return Mediabox.open(ac.map(Z),aa.indexOf(this.toString()),W);});return X;}});function M(){R.setStyles({top:window.getScrollTop(),left:window.getScrollLeft()});}function o(){h=window.getWidth();K=window.getHeight();R.setStyles({width:h,height:K});}function p(W){if(Browser.firefox){["object",window.ie?"select":"embed"].forEach(function(Y){Array.forEach($$(Y),function(Z){if(W){Z._mediabox=Z.style.visibility;}Z.style.visibility=W?"hidden":Z._mediabox;});});}R.style.display=W?"":"none";var X=W?"addEvent":"removeEvent";if(Browser.Platform.ios||Browser.ie6){window[X]("scroll",M);}window[X]("resize",o);if(y.keyboard){document[X]("keydown",s);}}function s(W){if(y.keyboardAlpha){switch(W.code){case 27:case 88:case 67:P();break;case 37:case 80:L();break;case 39:case 78:f();}}else{switch(W.code){case 27:P();break;case 37:L();break;case 39:f();}}if(y.keyboardStop){return false;}}function L(){return G(r);}function f(){return G(w);}function G(X){if(X>=0){O.set("html","");z=X;r=((z||!y.loop)?z:H.length)-1;w=z+1;if(w==H.length){w=y.loop?0:-1;}t();a.className="mbLoading";if(q&&g=="inline"&&!y.inlineClone){q.adopt(O.getChildren());}if(!H[X][2]){H[X][2]="";}Q=H[X][2].split(" ");F=Q.length;if(F>1){A=(Q[F-2].match("%"))?(window.getWidth()*((Q[F-2].replace("%",""))*0.01)):Q[F-2];m=(Q[F-1].match("%"))?(window.getHeight()*((Q[F-1].replace("%",""))*0.01)):Q[F-1];}else{A="";m="";}B=H[X][0];T=H[z][1].split("::");if(B.match(/quietube\.com/i)){e=B.split("v.php/");B=e[1];}else{if(B.match(/\/\/yfrog/i)){g=(B.substring(B.length-1));if(g.match(/b|g|j|p|t/i)){g="image";}if(g=="s"){g="flash";}if(g.match(/f|z/i)){g="video";}B=B+":iphone";}}if(B.match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i)||g=="image"){g="img";B=B.replace(/twitpic\.com/i,"twitpic.com/show/full");q=new Image();q.onload=n;q.src=B;}else{if(B.match(/\.flv|\.mp4/i)||g=="video"){g="obj";A=A||y.defaultWidth;m=m||y.defaultHeight;q=new Swiff(""+y.playerpath+"?mediaURL="+B+"&allowSmoothing=true&autoPlay="+y.autoplay+"&buffer=6&showTimecode="+y.showTimecode+"&loop="+y.medialoop+"&controlColor="+y.controlColor+"&controlBackColor="+y.controlBackColor+"&playerBackColor="+y.playerBackColor+"&defaultVolume="+y.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"mbVideo",width:A,height:m,params:{wmode:y.wmodeNB,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/\.mp3|\.aac|tweetmic\.com|tmic\.fm/i)||g=="audio"){g="obj";A=A||y.defaultWidth;m=m||"17";if(B.match(/tweetmic\.com|tmic\.fm/i)){B=B.split("/");B[4]=B[4]||B[3];B="http://media4.fjarnet.net/tweet/tweetmicapp-"+B[4]+".mp3";}q=new Swiff(""+y.playerpath+"?mediaURL="+B+"&allowSmoothing=true&autoPlay="+y.autoplay+"&buffer=6&showTimecode="+y.showTimecode+"&loop="+y.medialoop+"&controlColor="+y.controlColor+"&controlBackColor="+y.controlBackColor+"&defaultVolume="+y.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"mbAudio",width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/\.swf/i)||g=="flash"){g="obj";A=A||y.defaultWidth;m=m||y.defaultHeight;q=new Swiff(B,{id:"mbFlash",width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/\.mov|\.m4v|\.m4a|\.aiff|\.avi|\.caf|\.dv|\.mid|\.m3u|\.mp3|\.mp2|\.mp4|\.qtz/i)||g=="qt"){g="qt";A=A||y.defaultWidth;m=(parseInt(m,10)+16)||y.defaultHeight;q=new Quickie(B,{id:"MediaboxQT",width:A,height:m,attributes:{controller:y.controller,autoplay:y.autoplay,volume:y.volume,loop:y.medialoop,bgcolor:y.bgcolor}});n();}else{if(B.match(/blip\.tv/i)){g="obj";A=A||"640";m=m||"390";q=new Swiff(B,{src:B,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/break\.com/i)){g="obj";A=A||"464";m=m||"376";c=B.match(/\d{6}/g);q=new Swiff("http://embed.break.com/"+c,{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/dailymotion\.com/i)){g="obj";A=A||"480";m=m||"381";q=new Swiff(B,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/facebook\.com/i)){g="obj";A=A||"320";m=m||"240";e=B.split("v=");e=e[1].split("&");c=e[0];q=new Swiff("http://www.facebook.com/v/"+c,{movie:"http://www.facebook.com/v/"+c,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/flickr\.com(?!.+\/show\/)/i)){g="obj";A=A||"500";m=m||"375";e=B.split("/");c=e[5];q=new Swiff("http://www.flickr.com/apps/video/stewart.swf",{id:c,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:A,height:m,params:{flashvars:"photo_id="+c+"&amp;show_info_box="+y.flInfo,wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/gametrailers\.com/i)){g="obj";A=A||"480";m=m||"392";c=B.match(/\d{5}/g);q=new Swiff("http://www.gametrailers.com/remote_wrap.php?mid="+c,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/google\.com\/videoplay/i)){g="obj";A=A||"400";m=m||"326";e=B.split("=");c=e[1];q=new Swiff("http://video.google.com/googleplayer.swf?docId="+c+"&autoplay="+y.autoplayNum,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/megavideo\.com/i)){g="obj";A=A||"640";m=m||"360";e=B.split("=");c=e[1];q=new Swiff("http://wwwstatic.megavideo.com/mv_player.swf?v="+c,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/metacafe\.com\/watch/i)){g="obj";A=A||"400";m=m||"345";e=B.split("/");c=e[4];q=new Swiff("http://www.metacafe.com/fplayer/"+c+"/.swf?playerVars=autoPlay="+y.autoplayYes,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/vids\.myspace\.com/i)){g="obj";A=A||"425";m=m||"360";q=new Swiff(B,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/revver\.com/i)){g="obj";A=A||"480";m=m||"392";e=B.split("/");c=e[4];q=new Swiff("http://flash.revver.com/player/1.0/player.swf?mediaId="+c+"&affiliateId="+y.revverID+"&allowFullScreen="+y.revverFullscreen+"&autoStart="+y.autoplay+"&backColor=#"+y.revverBack+"&frontColor=#"+y.revverFront+"&gradColor=#"+y.revverGrad+"&shareUrl=revver",{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/rutube\.ru/i)){g="obj";A=A||"470";m=m||"353";e=B.split("=");c=e[1];q=new Swiff("http://video.rutube.ru/"+c,{movie:"http://video.rutube.ru/"+c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/tudou\.com/i)){g="obj";A=A||"400";m=m||"340";e=B.split("/");c=e[5];q=new Swiff("http://www.tudou.com/v/"+c,{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/twitcam\.com/i)){g="obj";A=A||"320";m=m||"265";e=B.split("/");c=e[3];q=new Swiff("http://static.livestream.com/chromelessPlayer/wrappers/TwitcamPlayer.swf?hash="+c,{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/twitvid\.com/i)){g="obj";A=A||"600";m=m||"338";e=B.split("/");c=e[3];q=new Swiff("http://www.twitvid.com/player/"+c,{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/ustream\.tv/i)){g="obj";A=A||"400";m=m||"326";q=new Swiff(B+"&amp;viewcount="+y.usViewers+"&amp;autoplay="+y.autoplay,{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/youku\.com/i)){g="obj";A=A||"480";m=m||"400";e=B.split("id_");c=e[1];q=new Swiff("http://player.youku.com/player.php/sid/"+c+"=/v.swf",{width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/youtube\.com\/watch/i)){e=B.split("v=");if(y.html5){g="url";var W="http://www.youtube.com/embed/";var Y=e[1].split("&list=");if(Y){W+="p/";e[1]=Y[1].replace("PL","");A=A||"480";m=m||"385";}else{A=A||"640";m=m||"385";}c="mediaId_"+new Date().getTime();q=new Element("iframe",{src:W+e[1]+"?autoplay="+y.autoplayNum,id:c,width:A,height:m,frameborder:0});n();}else{g="obj";c=e[1];A=A||"480";m=m||"385";q=new Swiff("http://www.youtube.com/v/"+c+"&autoplay="+y.autoplayNum+"&fs="+y.fullscreenNum+"&border="+y.ytBorder+"&color1=0x"+y.ytColor1+"&color2=0x"+y.ytColor2+"&rel="+y.ytRel+"&showinfo="+y.ytInfo+"&showsearch="+y.ytSearch,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}}else{if(B.match(/youtube\.com\/view/i)){g="obj";e=B.split("p=");c=e[1];A=A||"480";m=m||"385";q=new Swiff("http://www.youtube.com/p/"+c+"&autoplay="+y.autoplayNum+"&fs="+y.fullscreenNum+"&border="+y.ytBorder+"&color1=0x"+y.ytColor1+"&color2=0x"+y.ytColor2+"&rel="+y.ytRel+"&showinfo="+y.ytInfo+"&showsearch="+y.ytSearch,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/veoh\.com/i)){g="obj";A=A||"410";m=m||"341";B=B.replace("%3D","/");e=B.split("watch/");c=e[1];q=new Swiff("http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.5.2.1001&permalinkId="+c+"&player=videodetailsembedded&videoAutoPlay="+y.AutoplayNum+"&id=anonymous",{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}else{if(B.match(/viddler\.com/i)){g="obj";A=A||"437";m=m||"370";e=B.split("/");c=e[4];q=new Swiff(B,{id:"viddler_"+c,movie:B,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen,id:"viddler_"+c,movie:B}});n();}else{if(B.match(/vimeo\.com/i)){A=A||"640";m=m||"360";e=B.split("/");c=e[3];if(y.html5){g="url";c="mediaId_"+new Date().getTime();q=new Element("iframe",{src:"http://player.vimeo.com/video/"+e[3]+"?portrait="+y.vmPortrait,id:c,width:A,height:m,frameborder:0});n();}else{g="obj";q=new Swiff("http://www.vimeo.com/moogaloop.swf?clip_id="+c+"&amp;server=www.vimeo.com&amp;fullscreen="+y.fullscreenNum+"&amp;autoplay="+y.autoplayNum+"&amp;show_title="+y.vmTitle+"&amp;show_byline="+y.vmByline+"&amp;show_portrait="+y.vmPortrait+"&amp;color="+y.vmColor,{id:c,width:A,height:m,params:{wmode:y.wmode,bgcolor:y.bgcolor,allowscriptaccess:y.scriptaccess,allowfullscreen:y.fullscreen}});n();}}else{if(B.match(/\#mb_/i)){g="inline";A=A||y.defaultWidth;m=m||y.defaultHeight;URLsplit=B.split("#");q=document.id(URLsplit[1]);n();}else{g="url";A=A||y.defaultWidth;m=m||y.defaultHeight;c="mediaId_"+new Date().getTime();q=new Element("iframe",{src:B,id:c,width:A,height:m,frameborder:0});n();}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return false;}function n(){(g=="img")?O.addEvent("click",f):O.removeEvent("click",f);if(g=="img"){A=q.width;m=q.height;if(y.imgBackground){O.setStyles({backgroundImage:"url("+B+")",display:""});}else{if(m>=K-y.imgPadding&&(m/K)>=(A/h)){m=K-y.imgPadding;A=q.width=parseInt((m/q.height)*A,10);q.height=m;}else{if(A>=h-y.imgPadding&&(m/K)<(A/h)){A=h-y.imgPadding;m=q.height=parseInt((A/q.width)*m,10);q.width=A;}}if(Browser.ie){q=document.id(q);}if(y.clickBlock){q.addEvent("mousedown",function(W){W.stop();}).addEvent("contextmenu",function(W){W.stop();});}O.setStyles({backgroundImage:"none",display:""});q.inject(O);}}else{if(g=="inline"){O.setStyles({backgroundImage:"none",display:""});(y.inlineClone)?O.grab(q.get("html")):O.adopt(q.getChildren());}else{if(g=="qt"){O.setStyles({backgroundImage:"none",display:""});q.inject(O);}else{if(g=="ios"||Browser.Platform.ios){O.setStyles({backgroundImage:"none",display:""});O.set("html",y.linkText.replace(/\{x\}/gi,B));A=y.defaultWidth;m=y.defaultHeight;}else{if(g=="url"){O.setStyles({backgroundImage:"none",display:""});q.inject(O);}else{if(g=="obj"){if(Browser.Plugins.Flash.version<"8"){O.setStyles({backgroundImage:"none",display:""});O.set("html",'<div id="mbError"><b>Error</b><br/>Adobe Flash is either not installed or not up to date, please visit <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" title="Get Flash" target="_new">Adobe.com</a> to download the free player.</div>');A=y.defaultWidth;m=y.defaultHeight;}else{O.setStyles({backgroundImage:"none",display:""});q.inject(O);}}else{O.setStyles({backgroundImage:"none",display:""});O.set("html",y.flashText);A=y.defaultWidth;m=y.defaultHeight;}}}}}}D.set("html",(y.showCaption)?T[0]:"");N.set("html",(y.showCaption&&(T.length>1))?T[1]:"");V.set("html",(y.showCounter&&(H.length>1))?y.counterText.replace(/\{x\}/,(y.countBack)?H.length-z:z+1).replace(/\{y\}/,H.length):"");if((r>=0)&&(H[r][0].match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i))){x.src=H[r][0].replace(/twitpic\.com/i,"twitpic.com/show/full");}if((w>=0)&&(H[w][0].match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i))){U.src=H[w][0].replace(/twitpic\.com/i,"twitpic.com/show/full");}if(r>=0){S.style.display="";}if(w>=0){d.style.display="";}O.setStyles({width:A+"px",height:m+"px"});b.setStyles({width:A-C+"px"});N.setStyles({width:A-C+"px"});A=O.offsetWidth;m=O.offsetHeight+b.offsetHeight;if(m>=l+l){E=-l;}else{E=-(m/2);}if(A>=i+i){k=-i;}else{k=-(A/2);}if(y.resizeOpening){v.resize.start({width:A,height:m,marginTop:E-j,marginLeft:k-j});}else{a.setStyles({width:A,height:m,marginTop:E-j,marginLeft:k-j});J();}}function J(){v.media.start(1);}function I(){a.className="";v.bottom.start(1);}function t(){if(q){if(g=="inline"&&!y.inlineClone){q.adopt(O.getChildren());}q.onload=function(){};}v.resize.cancel();v.media.cancel().set(0);v.bottom.cancel().set(0);$$(S,d).setStyle("display","none");}function P(){if(z>=0){if(g=="inline"&&!y.inlineClone){q.adopt(O.getChildren());}q.onload=function(){};O.empty();for(var W in v){v[W].cancel();}a.setStyle("display","none");v.overlay.chain(p).start(0);}return false;}})();Browser.Plugins.QuickTime=(function(){if(navigator.plugins){for(var b=0,a=navigator.plugins.length;b<a;b++){if(navigator.plugins[b].name.indexOf("QuickTime")>=0){return true;}}}else{var d;try{d=new ActiveXObject("QuickTime.QuickTime");}catch(c){}if(d){return true;}}return false;})();Mediabox.scanPage=function(){var a=$$("a").filter(function(b){return b.rel&&b.rel.test(/^lightbox/i);});a.mediabox({},null,function(c){var b=this.rel.replace(/[\[\]|]/gi," ");var d=b.split(" ");var e="\\["+d[1]+"[ \\]]";var f=new RegExp(e);return(this==c)||((this.rel.length>8)&&c.rel.match(f));});};window.addEvents({domready:Mediabox.scanPage,resize:Mediabox.recenter});(function(a){this.TinyTab=new Class({Implements:Events,initialize:function(c,d,b){this.tabs=c;this.contents=d;if(!b){b={};}this.css=b.selectedClass||"selected";this.select(this.tabs[0]);c.each(function(e){e.addEvent("click",function(f){this.select(e);f.stop();}.bind(this));}.bind(this));},select:function(b){this.tabs.removeClass(this.css);b.addClass(this.css);this.contents.setStyle("display","none");var c=this.contents[this.tabs.indexOf(b)];c.setStyle("display","block");this.fireEvent("change",[c,b]);}});})(document.id);var TabsFactory=function(b,a,c){b=document.id(b);if(b){if(typeof a=="undefined"){a="ul.tabs > li";}if(typeof c=="undefined"){c="ul.tabcontents > li";}return new TinyTab(b.getElements(a),b.getElements(c));}else{return false;}};var Loop=new Class({loopCount:0,isLooping:false,loopMethod:function(){},setLoop:function(b,a){var c=this.isLooping;if(c){this.stopLoop();}this.loopMethod=b;this.loopDelay=a||3000;if(c){this.startLoop();}return this;},stopLoop:function(){this.isLooping=false;clearInterval(this.periodical);return this;},startLoop:function(b,a){if(!this.isLooping){this.isLooping=true;if(a){this.looper();}this.periodical=this.looper.periodical(b||this.loopDelay,this);}return this;},resetLoop:function(){this.loopCount=0;return this;},looper:function(){this.loopCount++;this.loopMethod(this.loopCount);return this;}});(function(){var a=this.SlideShow=new Class({Implements:[Options,Events,Loop],options:{delay:7000,transition:"crossFade",duration:500,autoplay:false,dataAttribute:"data-slideshow",selector:"> *",initialSlideIndex:0},transitioning:false,reversed:false,initialize:function(c,b,d){this.element=document.id(c);this.setOptions(b);if(!d){this.setup();}},setup:function(b){if(b){this.setOptions(b);}this.slides=this.element.getElements(this.options.selector);this.setupElement().setupSlides();this.current=this.current||this.slides[this.options.initialSlideIndex];this.index=this.current.retrieve("slideshow-index");this.setLoop(this.show.pass(this.reversed?"previous":"next",this),this.options.delay);if(this.options.autoplay){this.play();}return this;},show:function(c,d){if(c=="next"||c=="previous"){c=this[c+"Slide"]();}if(typeof c=="number"){c=this.slides[c];}if(c==this.current||this.transitioning){return this;}this.transitioning=true;this.current.store("slideshow:oldStyles",this.current.get("style"));var h=(d&&d.transition)?d.transition:c.retrieve("slideshow-transition"),g=(d&&d.duration)?d.duration:c.retrieve("slideshow-duration"),f=this.current.setStyle("z-index",1),e=this.reset(c).setStyle("z-index",0),b=this.index=e.retrieve("slideshow-index");slideData={previous:{element:f,index:f.retrieve("slideshow-index")},next:{element:e,index:b}};this.fireEvent("show",slideData);a.transitions[h]({previous:f,next:e,duration:g,instance:this});(function(){f.setStyle("display","none");this.fireEvent("showComplete",slideData);this.transitioning=false;}).bind(this).delay(g);this.current=e;return this;},play:function(){this.startLoop();this.fireEvent("play");return this;},pause:function(){this.stopLoop();this.fireEvent("pause");return this;},reverse:function(){this.setLoop(this.show.pass(this.reversed?"next":"previous",this),this.options.delay);this.reversed=!this.reversed;this.fireEvent("reverse");return this;},setupElement:function(){this.storeData(this.element);this.options.duration=this.element.retrieve("slideshow-duration");this.options.transition=this.element.retrieve("slideshow-transition");this.options.delay=this.element.retrieve("slideshow-delay");if(this.element.getStyle("position")=="static"){this.element.setStyle("position","relative");}return this;},setupSlides:function(){this.slides.each(function(b,c){b.store("slideshow-index",c).store("slideshow:oldStyles",b.get("style"));this.storeData(b);b.setStyle("display",(this.current||c==this.options.initialSlideIndex)?"":"none");},this);return this;},storeData:function(b){var c=this.options;b.store("slideshow-transition",c.transition);b.store("slideshow-duration",c.duration);if(b==this.element){b.store("slideshow-delay",c.delay);}var d=b.get(this.options.dataAttribute);if(!d){return this;}Slick.parse(d).expressions[0].each(function(e){b.store("slideshow-"+e.tag,e.pseudos[0].key);});return this;},reset:function(b){return b.set("style",b.retrieve("slideshow:oldStyles"));},nextSlide:function(){return this.slides[this.index+1]||this.slides[0];},previousSlide:function(){return this.slides[this.index-1]||this.slides.getLast();},toElement:function(){return this.element;}});a.transitions={};a.defineTransition=function(b,c){a.transitions[b]=c;};a.defineTransitions=function(b){Object.each(b,function(d,c){a.defineTransition(c,d);});};})();Element.Properties.slideshow={set:function(a){this.get("slideshow").setup(a);return this;},get:function(){var a=this.retrieve("slideshow");if(!a){a=new SlideShow(this,{},true);this.store("slideshow",a);}return a;}};Element.implement({playSlideShow:function(a){this.get("slideshow").setup(a).play();return this;},pauseSlideShow:function(){this.get("slideshow").pause();return this;}});SlideShow.defineTransitions({none:function(a){a.previous.setStyle("display","none");return this;},fade:function(a){a.previous.set("tween",{duration:a.duration}).fade("out");return this;},crossFade:function(a){a.previous.set("tween",{duration:a.duration}).fade("out");a.next.set("tween",{duration:a.duration}).fade("in");return this;},fadeThroughBackground:function(b){var a=b.duration/2;b.next.set("tween",{duration:a}).fade("hide");b.previous.set("tween",{duration:a,onComplete:function(){b.next.fade("in");}}).fade("out");return this;}});(function(){function a(c){return{property:(c=="left"||c=="right")?"left":"top",inverted:(c=="left"||c=="up")?1:-1};}function b(c,d,e){var f={duration:e.duration,unit:"%"};if(c=="blind"){e.next.setStyle("z-index",2);}if(c!="slide"){e.next.set("tween",f).setStyle(d.property,100*d.inverted+"%");e.next.tween(d.property,0);}if(c!="blind"){e.previous.set("tween",f).tween(d.property,-(100*d.inverted));}}["left","right","up","down"].each(function(e){var f=e.capitalize(),c="blind"+f,d="slide"+f;[["push"+f,(function(){var g=a(e);return function(h){b("push",g,h);};}())],[c,(function(){var g=a(e);return function(h){b("blind",g,h);};}())],[d,(function(){var g=a(e);return function(h){b("slide",g,h);};}())],[c+"Fade",function(g){this.fade(g)[c](g);return this;}]].each(function(g){SlideShow.defineTransition(g[0],g[1]);});});})();(function(){function b(c){return{property:(c=="left"||c=="right")?"x":"y",inverted:(c=="left"||c=="up")?1:-1};}function a(d,c,e){var f={duration:e.duration+"ms","timing-function":"ease",property:"transform"};if(d=="blind"){e.next.setStyle("z-index",2);}if(d!="slide"){e.next.translate(c.property,100*c.inverted);}setTimeout(function(){if(d!="slide"){e.next.setTransition(f).translate(c.property,0);}if(d!="blind"){e.previous.setTransition(f).translate(c.property,-(100*c.inverted));}},0);}["left","right","up","down"].each(function(e){var f=e.capitalize(),c="blind"+f+"CSS",d="slide"+f+"CSS";[["push"+f+"CSS",(function(){var g=b(e);return function(h){a("push",g,h);};}())],[c,(function(){var g=b(e);return function(h){a("blind",g,h);};}())],[d,(function(){var g=b(e);return function(h){a("slide",g,h);};}())]].each(function(g){SlideShow.defineTransition(g[0],g[1]);});});})();SlideShow.useCSS=function(){["left","right","up","down"].each(function(c){var d=c.capitalize(),a="blind"+d,b="slide"+d;SlideShow.transitions[a]=SlideShow.transitions[a+"CSS"];SlideShow.transitions[b]=SlideShow.transitions[a+"CSS"];SlideShow.transitions["push"+d]=SlideShow.transitions["push"+d+"CSS"];});return this;};var mgrSlides=null;var sldBox=null;var SlideshowFactory=function(a,b){a=document.id(a);if(a){if(typeof b=="undefined"){b=a.getElements("article.rotator-item");}mgrSlides=new SlideShow(a,{selector:b,autoplay:true,delay:6000,transition:"pushLeft"});document.id("rotator-prev").addEvent("click",function(c){mgrSlides.pause().reverse();mgrSlides.show("previous",{transition:"pushRight"});});document.id("rotator-next").addEvent("click",function(c){mgrSlides.pause();mgrSlides.show("next",{transition:"pushLeft"});});sldBox=a;return mgrSlides;}else{return false;}};

