rate-it/public/js/mootools/mediabox/mediabox-rateit.js
2014-10-01 07:19:14 +02:00

1 line
21 KiB
JavaScript

var Mediabox;(function(){function q(){v.setStyles({top:window.getScrollTop(),left:window.getScrollLeft()})}function R(){f=window.getWidth();l=window.getHeight();v.setStyles({width:f,height:l})}function U(t){if(Browser.firefox){["object",window.ie?"select":"embed"].forEach(function(e){Array.forEach($$(e),function(e){if(t)e._mediabox=e.style.visibility;e.style.visibility=t?"hidden":e._mediabox})})}v.style.display=t?"":"none";var n=t?"addEvent":"removeEvent";if(Browser.Platform.ios||Browser.ie6)window[n]("scroll",q);window[n]("resize",R);if(e.keyboard)document[n]("keydown",z)}function z(t){if(e.keyboardAlpha){switch(t.code){case 27:case 88:case 67:G();break;case 37:case 80:W();break;case 39:case 78:X()}}else{switch(t.code){case 27:G();break;case 37:W();break;case 39:X()}}if(e.keyboardStop){return false}}function W(){return V(r)}function X(){return V(i)}function V(s){if(s>=0){g.set("html","");n=s;r=(n||!e.loop?n:t.length)-1;i=n+1;if(i==t.length)i=e.loop?0:-1;Q();m.className="mbLoading";if(h&&H=="inline"&&!e.inlineClone)h.adopt(g.getChildren());if(!t[s][2])t[s][2]="";O=t[s][2].split(" ");M=O.length;if(M>1){D=O[M-2].match("%")?window.getWidth()*O[M-2].replace("%","")*.01+"px":O[M-2]+"px";P=O[M-1].match("%")?window.getHeight()*O[M-1].replace("%","")*.01+"px":O[M-1]+"px"}else{D="";P=""}o=t[s][0];b=t[n][1].split("::");if(o.match(/quietube\.com/i)){B=o.split("v.php/");o=B[1]}else if(o.match(/\/\/yfrog/i)){H=o.substring(o.length-1);if(H.match(/b|g|j|p|t/i))H="image";if(H=="s")H="flash";if(H.match(/f|z/i))H="video";o=o+":iphone"}if(o.match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i)||H=="image"){H="img";o=o.replace(/twitpic\.com/i,"twitpic.com/show/full");h=new Image;h.onload=$;h.src=o}else if(o.match(/\.flv|\.mp4/i)||H=="video"){H="obj";D=D||e.defaultWidth;P=P||e.defaultHeight;var o=(new URI(o)).toAbsolute();if(e.useNB){h=new Swiff(""+e.playerpath+"?mediaURL="+o+"&allowSmoothing=true&autoPlay="+e.autoplay+"&buffer=6&showTimecode="+e.showTimecode+"&loop="+e.medialoop+"&controlColor="+e.controlColor+"&controlBackColor="+e.controlBackColor+"&defaultVolume="+e.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}else{h=new Swiff(""+e.JWplayerpath+"?file="+o+"&backcolor="+e.backcolor+"&frontcolor="+e.frontcolor+"&lightcolor="+e.lightcolor+"&screencolor="+e.screencolor+"&autostart="+e.autoplay+"&controlbar="+e.controlbar,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}$()}else if(o.match(/\.mp3|\.aac|tweetmic\.com|tmic\.fm/i)||H=="audio"){H="obj";D=D||e.defaultWidth;P=P||"20px";if(o.match(/tweetmic\.com|tmic\.fm/i)){o=o.split("/");o[4]=o[4]||o[3];o="http://media4.fjarnet.net/tweet/tweetmicapp-"+o[4]+".mp3"}if(e.useNB){h=new Swiff(""+e.playerpath+"?mediaURL="+o+"&allowSmoothing=true&autoPlay="+e.autoplay+"&buffer=6&showTimecode="+e.showTimecode+"&loop="+e.medialoop+"&controlColor="+e.controlColor+"&controlBackColor="+e.controlBackColor+"&defaultVolume="+e.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}else{h=new Swiff(""+e.JWplayerpath+"?file="+o+"&backcolor="+e.backcolor+"&frontcolor="+e.frontcolor+"&lightcolor="+e.lightcolor+"&screencolor="+e.screencolor+"&autostart="+e.autoplay,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}$()}else if(o.match(/\.swf/i)||H=="flash"){H="obj";D=D||e.defaultWidth;P=P||e.defaultHeight;h=new Swiff(o,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/\.mov|\.m4v|\.m4a|\.aiff|\.avi|\.caf|\.dv|\.mid|\.m3u|\.mp3|\.mp2|\.mp4|\.qtz/i)||H=="qt"){H="qt";D=D||e.defaultWidth;P=parseInt(P)+16+"px"||e.defaultHeight;h=new Quickie(o,{id:"MediaboxQT",width:D,height:P,attributes:{controller:e.controller,autoplay:e.autoplay,volume:e.volume,loop:e.medialoop,bgcolor:e.bgcolor}});$()}else if(o.match(/blip\.tv/i)){H="obj";D=D||"640px";P=P||"390px";h=new Swiff(o,{src:o,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/break\.com/i)){H="obj";D=D||"464px";P=P||"376px";j=o.match(/\d{6}/g);h=new Swiff("http://embed.break.com/"+j,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/dailymotion\.com/i)){H="obj";D=D||"480px";P=P||"381px";h=new Swiff(o,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/facebook\.com/i)){H="obj";D=D||"320px";P=P||"240px";B=o.split("v=");B=B[1].split("&");j=B[0];h=new Swiff("http://www.facebook.com/v/"+j,{movie:"http://www.facebook.com/v/"+j,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/flickr\.com(?!.+\/show\/)/i)){H="obj";D=D||"500px";P=P||"375px";B=o.split("/");j=B[5];h=new Swiff("http://www.flickr.com/apps/video/stewart.swf",{id:j,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:D,height:P,params:{flashvars:"photo_id="+j+"&show_info_box="+e.flInfo,wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/gametrailers\.com/i)){H="obj";D=D||"480px";P=P||"392px";j=o.match(/\d{5}/g);h=new Swiff("http://www.gametrailers.com/remote_wrap.php?mid="+j,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/google\.com\/videoplay/i)){H="obj";D=D||"400px";P=P||"326px";B=o.split("=");j=B[1];h=new Swiff("http://video.google.com/googleplayer.swf?docId="+j+"&autoplay="+e.autoplayNum,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/megavideo\.com/i)){H="obj";D=D||"640px";P=P||"360px";B=o.split("=");j=B[1];h=new Swiff("http://wwwstatic.megavideo.com/mv_player.swf?v="+j,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/metacafe\.com\/watch/i)){H="obj";D=D||"400px";P=P||"345px";B=o.split("/");j=B[4];h=new Swiff("http://www.metacafe.com/fplayer/"+j+"/.swf?playerVars=autoPlay="+e.autoplayYes,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/vids\.myspace\.com/i)){H="obj";D=D||"425px";P=P||"360px";h=new Swiff(o,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/revver\.com/i)){H="obj";D=D||"480px";P=P||"392px";B=o.split("/");j=B[4];h=new Swiff("http://flash.revver.com/player/1.0/player.swf?mediaId="+j+"&affiliateId="+e.revverID+"&allowFullScreen="+e.revverFullscreen+"&autoStart="+e.autoplay+"&backColor=#"+e.revverBack+"&frontColor=#"+e.revverFront+"&gradColor=#"+e.revverGrad+"&shareUrl=revver",{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/rutube\.ru/i)){H="obj";D=D||"470px";P=P||"353px";B=o.split("=");j=B[1];h=new Swiff("http://video.rutube.ru/"+j,{movie:"http://video.rutube.ru/"+j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/seesmic\.com/i)){H="obj";D=D||"435px";P=P||"355px";B=o.split("/");j=B[5];h=new Swiff("http://seesmic.com/Standalone.swf?video="+j,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/tudou\.com/i)){H="obj";D=D||"400px";P=P||"340px";B=o.split("/");j=B[5];h=new Swiff("http://www.tudou.com/v/"+j,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/twitcam\.com/i)){H="obj";D=D||"320px";P=P||"265px";B=o.split("/");j=B[3];h=new Swiff("http://static.livestream.com/chromelessPlayer/wrappers/TwitcamPlayer.swf?hash="+j,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/twiturm\.com/i)){H="obj";D=D||"402px";P=P||"48px";B=o.split("/");j=B[3];h=new Swiff("http://twiturm.com/flash/twiturm_mp3.swf?playerID=0&sf="+j,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/twitvid\.com/i)){H="obj";D=D||"600px";P=P||"338px";B=o.split("/");j=B[3];h=new Swiff("http://www.twitvid.com/player/"+j,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/ustream\.tv/i)){H="obj";D=D||"400px";P=P||"326px";h=new Swiff(o+"&viewcount="+e.usViewers+"&autoplay="+e.autoplay,{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/youku\.com/i)){H="obj";D=D||"480px";P=P||"400px";B=o.split("id_");j=B[1];h=new Swiff("http://player.youku.com/player.php/sid/"+j+"=/v.swf",{width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/youtube\.com\/watch/i)){B=o.split("v=");if(e.html5){H="url";D=D||"640px";P=P||"385px";j="mediaId_"+(new Date).getTime();h=new Element("iframe",{src:"http://www.youtube.com/embed/"+B[1],id:j,width:D,height:P,frameborder:0,allowTransparency:true});$()}else{H="obj";j=B[1];if(j.match(/fmt=22/i)){F="&ap=%2526fmt%3D22";D=D||"640px";P=P||"385px"}else if(j.match(/fmt=18/i)){F="&ap=%2526fmt%3D18";D=D||"560px";P=P||"345px"}else{F=e.ytQuality;D=D||"480px";P=P||"295px"}h=new Swiff("http://www.youtube.com/v/"+j+"&autoplay="+e.autoplayNum+"&fs="+e.fullscreenNum+F+"&border="+e.ytBorder+"&color1=0x"+e.ytColor1+"&color2=0x"+e.ytColor2+"&rel="+e.ytRel+"&showinfo="+e.ytInfo+"&showsearch="+e.ytSearch,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}}else if(o.match(/youtube\.com\/view/i)){H="obj";B=o.split("p=");j=B[1];D=D||"480px";P=P||"385px";h=new Swiff("http://www.youtube.com/p/"+j+"&autoplay="+e.autoplayNum+"&fs="+e.fullscreenNum+F+"&border="+e.ytBorder+"&color1=0x"+e.ytColor1+"&color2=0x"+e.ytColor2+"&rel="+e.ytRel+"&showinfo="+e.ytInfo+"&showsearch="+e.ytSearch,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/veoh\.com/i)){H="obj";D=D||"410px";P=P||"341px";o=o.replace("%3D","/");B=o.split("watch/");j=B[1];h=new Swiff("http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.5.2.1001&permalinkId="+j+"&player=videodetailsembedded&videoAutoPlay="+e.AutoplayNum+"&id=anonymous",{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/viddler\.com/i)){H="obj";D=D||"437px";P=P||"370px";B=o.split("/");j=B[4];h=new Swiff(o,{id:"viddler_"+j,movie:o,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen,id:"viddler_"+j,movie:o}});$()}else if(o.match(/viddyou\.com/i)){H="obj";D=D||"416px";P=P||"312px";B=o.split("=");j=B[1];h=new Swiff("http://www.viddyou.com/get/v2_"+e.vuPlayer+"/"+j+".swf",{id:j,movie:"http://www.viddyou.com/get/v2_"+e.vuPlayer+"/"+j+".swf",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/vimeo\.com/i)){D=D||"640px";P=P||"360px";B=o.split("/");j=B[3];if(e.html5){H="url";j="mediaId_"+(new Date).getTime();h=new Element("iframe",{src:"http://player.vimeo.com/video/"+B[3]+"?portrait="+e.vmPortrait,id:j,width:D,height:P,frameborder:0,allowTransparency:true});$()}else{H="obj";h=new Swiff("http://www.vimeo.com/moogaloop.swf?clip_id="+j+"&server=www.vimeo.com&fullscreen="+e.fullscreenNum+"&autoplay="+e.autoplayNum+"&show_title="+e.vmTitle+"&show_byline="+e.vmByline+"&show_portrait="+e.vmPortrait+"&color="+e.vmColor,{id:j,width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}}else if(o.match(/12seconds\.tv/i)){H="obj";D=D||"430px";P=P||"360px";B=o.split("/");j=B[5];h=new Swiff("http://embed.12seconds.tv/players/remotePlayer.swf",{id:j,width:D,height:P,params:{flashvars:"vid="+j+"",wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/\#mb_/i)){H="inline";D=D||e.defaultWidth;P=P||e.defaultHeight;URLsplit=o.split("#");h=document.id(URLsplit[1]);$()}else{H="url";D=D||e.defaultWidth;P=P||e.defaultHeight;j="mediaId_"+(new Date).getTime();h=new Element("iframe",{src:o,id:j,width:D,height:P,frameborder:0,allowTransparency:true});$()}}return false}function $(){H=="img"?g.addEvent("click",X):g.removeEvent("click",X);if(H=="img"){D=h.width;P=h.height;if(e.imgBackground){g.setStyles({backgroundImage:"url("+A+")",display:""})}else{if(P>=l-e.imgPadding&&P/l>=D/f){P=l-e.imgPadding;D=h.width=parseInt(P/h.height*D);h.height=P}else if(D>=f-e.imgPadding&&P/l<D/f){D=f-e.imgPadding;P=h.height=parseInt(D/h.width*P);h.width=D}if(Browser.ie)h=document.id(h);h.addEvent("mousedown",function(e){e.stop()}).addEvent("contextmenu",function(e){e.stop()});g.setStyles({backgroundImage:"none",display:""});h.inject(g)}}else if(H=="inline"){g.setStyles({backgroundImage:"none",display:""});e.inlineClone?g.grab(h.get("html")):g.adopt(h.getChildren())}else if(H=="qt"){g.setStyles({backgroundImage:"none",display:""});h.inject(g)}else if(H=="url"){g.setStyles({backgroundImage:"none",display:""});h.inject(g)}else if(H=="ios"||Browser.Platform.ios){g.setStyles({backgroundImage:"none",display:""});g.set("html",e.linkText.replace(/{x}/gi,A));D=e.DefaultWidth;P=e.DefaultHeight}else if(H=="obj"){if(Browser.Plugins.Flash.version<"8"){g.setStyles({backgroundImage:"none",display:""});g.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>');D=e.DefaultWidth;P=e.DefaultHeight}else{g.setStyles({backgroundImage:"none",display:""});h.inject(g)}}else{g.setStyles({backgroundImage:"none",display:""});g.set("html",e.flashText);D=e.defaultWidth;P=e.defaultHeight}g.setStyles({width:D,height:P});E.setStyles({width:D});w.set("html",e.showCaption?b[0]:"");E.set("html",e.showCaption&&b.length>1?b[1]:"");S.set("html",e.showCounter&&t.length>1?e.counterText.replace(/{x}/,n+1).replace(/{y}/,t.length):"");N.setStyles({display:"none"});if(typeof arrRatings=="object"){for(var v=0;v<arrRatings.length;v++){if(decodeURIComponent(h.src).endsWith(arrRatings[v].URL)){N.setStyles({display:"block"});if(arrRatings[v].rated){N.set("id","mb"+arrRatings[v].rateItID);RateItRating.initMe(N);ratingWrapper.removeEvents();C.setStyle("display","none");k.setStyle("width",arrRatings[v].width);k.setStyle("display","block");L.set("html",arrRatings[v].description)}else{N.set("id","mb"+arrRatings[v].rateItID);C.setStyle("display","block");k.setStyle("display","none");L.set("html",arrRatings[v].description);RateItRating.initMe(N)}break}}}if(r>=0&&t[r][0].match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i))p.src=t[r][0].replace(/twitpic\.com/i,"twitpic.com/show/full");if(i>=0&&t[i][0].match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i))d.src=t[i][0].replace(/twitpic\.com/i,"twitpic.com/show/full");D=g.offsetWidth;P=g.offsetHeight+y.offsetHeight;if(P>=s+s){o=-s}else{o=-(P/2)}if(D>=u+u){a=-u}else{a=-(D/2)}if(e.resizeOpening){c.resize.start({width:D,height:P,marginTop:o-I,marginLeft:a-I})}else{m.setStyles({width:D,height:P,marginTop:o-I,marginLeft:a-I});J()}}function J(){c.image.start(1)}function K(){m.className="";if(r>=0)x.style.display="";if(i>=0)T.style.display="";c.bottom.start(1)}function Q(){if(h){if(H=="inline"&&!e.inlineClone)h.adopt(g.getChildren());h.onload=function(){}}c.resize.cancel();c.image.cancel().set(0);c.bottom.cancel().set(0);$$(x,T).setStyle("display","none")}function G(){if(n>=0){if(H=="inline"&&!e.inlineClone)h.adopt(g.getChildren());h.onload=function(){};g.empty();for(var t in c)c[t].cancel();m.setStyle("display","none");c.overlay.chain(U).start(0)}window.fireEvent("mb_close");return false}var e,t,n,r,i,s,o,u,a,f,l,c,h,p=new Image,d=new Image,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H="none",B,j="mediaBox",F,I;window.addEvent("domready",function(){document.id(document.body).adopt($$([v=(new Element("div",{id:"mbOverlay"})).addEvent("click",G),m=new Element("div",{id:"mbCenter"})]).setStyle("display","none"));g=(new Element("div",{id:"mbImage"})).inject(m,"inside");y=(new Element("div",{id:"mbBottom"})).inject(m,"inside").adopt(closeLink=(new Element("a",{id:"mbCloseLink",href:"#"})).addEvent("click",G),T=(new Element("a",{id:"mbNextLink",href:"#"})).addEvent("click",X),x=(new Element("a",{id:"mbPrevLink",href:"#"})).addEvent("click",W),w=new Element("div",{id:"mbTitle"}),S=new Element("div",{id:"mbNumber"}),N=(new Element("div",{id:"mbRating","class":"mbrateItRating"})).adopt(ratingWrapper=(new Element("div",{"class":"wrapper"})).adopt(C=new Element("div",{"class":"rateItRating-selected",display:"block"}),k=new Element("div",{"class":"rateItRating-hover"})),L=new Element("div",{id:"mbRatingDescription","class":"mbratingText ratingText"})),E=new Element("div",{id:"mbCaption"}));c={overlay:(new Fx.Tween(v,{property:"opacity",duration:360})).set(0),image:new Fx.Tween(g,{property:"opacity",duration:360,onComplete:K}),bottom:(new Fx.Tween(y,{property:"opacity",duration:240})).set(0)}});Mediabox={close:function(){G()},open:function(n,r,i){e={buttonText:["<big>&laquo;</big>","<big>&raquo;</big>","<big>&times;</big>"],counterText:"({x} of {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:.7,resizeOpening:true,resizeDuration:240,initialWidth:320,initialHeight:180,defaultWidth:640,defaultHeight:360,showCaption:true,showCounter: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:"opaque",useNB:true,playerpath:"assets/mootools/mediabox/1.4.6/NonverBlaster.swf",controlColor:"0xFFFFFF",controlBackColor:"0x000000",showTimecode:"false",JWplayerpath:"assets/mootools/mediabox/1.4.6/player.swf",backcolor:"000000",frontcolor:"999999",lightcolor:"000000",screencolor:"000000",controlbar:"over",controller:"true",flInfo:"true",revverID:"187866",revverFullscreen:"true",revverBack:"000000",revverFront:"ffffff",revverGrad:"000000",usViewers:"true",ytBorder:"0",ytColor1:"000000",ytColor2:"333333",ytQuality:"&ap=%2526fmt%3D18",ytRel:"0",ytInfo:"1",ytSearch:"0",vuPlayer:"basic",vmTitle:"1",vmByline:"1",vmPortrait:"1",vmColor:"ffffff"};e=Object.merge(e,i);x.set("html",e.buttonText[0]);T.set("html",e.buttonText[1]);closeLink.set("html",e.buttonText[2]);I=(m.getStyle("padding-left").toInt()||0)+(g.getStyle("margin-left").toInt()||0)+(g.getStyle("padding-left").toInt()||0);if(Browser.firefox2){e.overlayOpacity=1;v.className="mbOverlayOpaque"}if(Browser.Platform.ios||Browser.ie6){if(Browser.Platform.ios)e.keyboard=false;e.resizeOpening=false;v.className="mbOverlayAbsolute";v.setStyle("position","absolute");q()}if(typeof n=="string"){n=[[n,r,i]];r=0}t=n;e.loop=e.loop&&t.length>1;R();U(true);s=window.getScrollTop()+window.getHeight()/2;u=window.getScrollLeft()+window.getWidth()/2;c.resize=new Fx.Morph(m,{duration:e.resizeDuration,onComplete:J});m.setStyles({top:s,left:u,width:e.initialWidth,height:e.initialHeight,marginTop:-(e.initialHeight/2)-I,marginLeft:-(e.initialWidth/2)-I,display:""});c.overlay.start(e.overlayOpacity);return V(r)}};Element.implement({mediabox:function(e,t){$$(this).mediabox(e,t);return this}});Elements.implement({mediabox:function(e,t,n){t=t||function(e){_=e.rel.split(/[\[\]]/);_=_[1];return[e.get("href"),e.title,_]};n=n||function(){return true};var r=this;r.removeEvents("click").addEvent("click",function(){var i=r.filter(n,this);var s=[];var o=[];i.each(function(e,t){if(o.indexOf(e.toString())<0){s.include(i[t]);o.include(i[t].toString())}});return Mediabox.open(s.map(t),o.indexOf(this.toString()),e)});return r}})})()