(function(){var a=Element.NativeEvents,b=window.location,c=b.pathname,d=window.history,e="pushState"in d,f=e?"popstate":"hashchange";this.History=new new Class({Implements:[Class.Binds,Events],_loc_history:[b],hash:null,pathname:null,initialize:function(){a[f]=e?2:1;window.addEvent(f,this.bound("pop"));this.hash=this.getLocation().hash;!e&&!("onhashchange"in window)&&(this.timer=this.periodical.periodical(200,this))},push:function(a,c,f){if(e)d.pushState(f||null,c||null,a);else if(this.hashFallback)b.hash=
a;else return window.location=a,!1;this.onChange(a,f)},pushHash:function(a){var c=this.getLocation().pathname||b.pathname;if(e)a=c+"#"+a;else if(this.hashFallback)a="#"+c+"#"+a;else return b.hash=a,!1;this.push(a)},replace:e?function(a,b,c){d.replaceState(c||null,b||null,a)}:function(a){this.hash="#"+a;this.push(a)},pop:e?function(a){var b=this.getLocation().href;this.hash=this.getLocation().hash;if(b==c)c=null;else this.onChange(b,a.event.state)}:function(){var a=this.getLocation().hash;this.hash!=
a&&(this.hash=a,this.onChange((a||null).substr(1)))},back:function(){d.back()},forward:function(){d.forward()},onChange:function(a,b){this._loc_history.unshift(this.getLocation());var c=this._loc_history[1],d=this._loc_history[0];d.hash!=c.hash&&this.fireEvent("hashchange",[a,b,d,{hash_change:!0,path_change:d.pathname!=c.pathname}]);d.pathname+d.search!=c.pathname+c.search&&this.fireEvent("change",[a,b,d,{hash_change:d.hash!=c.hash,path_change:!0}])},getPath:function(){return this.getLocation().pathname},
hasPushState:function(){return e},periodical:function(){this.hash!=b.hash&&this.pop()},pageLoad:function(){if(!1===e&&this.hash)this.onChange(this.hash.substr(1))},getHash:function(){return this.hash},getPathName:function(){return this.getLocation().pathname},getLocation:function(){var a=b.hash.toString().split("#");a.shift();var c=new URI(b);return{hash:e?b.hash:a[1],host:b.host,hostname:b.hostname,href:b.href,pathname:e?b.pathname:a[0],search:(c.parsed.query?"?":"")+(c.parsed.query||"")}}})})();
var ScrollSpy=new Class({Implements:[Options,Events],options:{container:window,max:0,min:0,mode:"vertical"},initialize:function(a){this.setOptions(a);this.container=document.id(this.options.container);this.enters=this.leaves=0;this.inside=!1;var b=this;this.listener=function(a){var d=b.container.getScroll(),e=d["vertical"===b.options.mode?"y":"x"];e>=b.options.min&&(0===b.options.max||e<=b.options.max)?(b.inside||(b.inside=!0,b.enters++,b.fireEvent("enter",[d,b.enters,a])),b.fireEvent("tick",[d,b.inside,
b.enters,b.leaves,a])):b.inside&&(b.inside=!1,b.leaves++,b.fireEvent("leave",[d,b.leaves,a]));b.fireEvent("scroll",[d,b.inside,b.enters,b.leaves,a])};this.addListener()},start:function(){this.container.addEvent("scroll",this.listener)},stop:function(){this.container.removeEvent("scroll",this.listener)},addListener:function(){this.start()}}),ThrottledScrollSpy=new Class({Extends:ScrollSpy,has_scrolled:!0,polling:!1,interval:250,e:null,initialize:function(a){this.bound={setHasScrolled:this.setHasScrolled.bind(this)};
this.parent(a);setTimeout(this.checkScrollPosition.bind(this),this.interval)},checkScrollPosition:function(){this.has_scrolled&&(this.listener(this.e),this.e=null,this.has_scrolled=!1);this.polling&&setTimeout(this.checkScrollPosition.bind(this),this.interval)},stopPolling:function(){this.polling=!1},setHasScrolled:function(a){this.e=a;this.has_scrolled=!0;if(!this.polling)return this.polling=!0,this.checkScrollPosition();setTimeout(this.stopPolling.bind(this),1E3)},start:function(){this.container.addEvent("scroll",
this.bound.setHasScrolled)},stop:function(){this.container.removeEvent("scroll",this.bound.setHasScrolled)}});
(function(){window.$clamp=function(a,b){var c,d,e,f;function g(a,b){q.getComputedStyle||(q.getComputedStyle=function(a){this.el=a;this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;"float"==b&&(b="styleFloat");c.test(b)&&(b=b.replace(c,function(a,b,c){return c.toUpperCase()}));return a.currentStyle&&a.currentStyle[b]?a.currentStyle[b]:null};return this});return q.getComputedStyle(a,null).getPropertyValue(b)}function h(b){var b=b||a.clientHeight,c=j(a);return Math.max(Math.floor(b/c),0)}function j(a){var b=
g(a,"line-height");"normal"==b&&(b=1.2*parseInt(g(a,"font-size")));return parseInt(b)}function p(b){return b.lastChild&&b.lastChild.children&&0 {display_name}Sponsored Links
"+c).addClass("ad-loaded"):$("google_afc_ads").dispose()}}
var Gallery=new Class({Implements:[Options,Events],options:{className:"photo_booth",loop:!1,moveNextOnMain:!0,mainImage:null,prevBtn:null,nextBtn:null,closeBtn:null,canClose:!0,hideNavigation:!0,onImageLoaded:function(){},onChange:function(){}},initialize:function(a,b,c){if(null===$(a))throw Error("Invalid element");if(0===b.length)throw Error("No image paths supplied");this.setOptions(c);this.container=$(a);this.sourceImages=b;this.createElements(b);this.attachEvents()},createElements:function(a){this.navigation||
(this.navigation=(new Element("nav")).inject(this.container),this.navigation.set("tween",{property:"opacity",duration:125,transition:Fx.Transitions.Sine.easeOut}),this.navigation.tween(0));this.currentIndex=0;this.mainImage=this.options.mainImage||this.createMainImage();this.prevBtn=this.options.prevBtn||this.createButton("btn btn_gray btn_prev","◄");this.nextBtn=this.options.nextBtn||this.createButton("btn btn_gray btn_next","►");this.loadedImages=[];this.images=new Asset.images(a,{onProgress:this.onImageLoaded.bind(this)});
this.options.canClose&&(this.closeBtn=this.options.closeBtn||this.createButton("btn btn_red btn_close","Close"));1===a.length&&(this.prevBtn.hide(),this.nextBtn.hide());this.prevBtn.addClass("btn_disabled")},attachEvents:function(){this.prevBtn.addEvent("click",this.onPrevClick.bind(this));this.nextBtn.addEvent("click",this.onNextClick.bind(this));this.options.moveNextOnMain&&this.mainImage.addEvent("click",this.onNextClick.bind(this));this.options.canClose&&this.closeBtn.addEvent("click",this.onCloseClick.bind(this));
this.options.hideNavigation&&(this.container.addEvent("mouseenter",this.onImageOver.bind(this)),this.container.addEvent("mouseleave",this.onImageOut.bind(this)))},createMainImage:function(){return(new Element("img",{"class":"main_portrait"})).inject(this.container)},createButton:function(a,b){return(new Element("a",{"class":a,html:b})).inject(this.navigation)},setSource:function(a){try{this.mainImage.set("src",a)}catch(b){this.mainImage.set("src",this.images[0].src)}},getMainImage:function(){return this.mainImage},
onImageLoaded:function(a,b){0===b&&this.mainImage.set("src",this.images[0].src);this.loadedImages.push(b);this.fireEvent("onImageLoaded")},onImageOver:function(){this.options.hideNavigation&&this.navigation.tween(1)},onImageOut:function(){this.options.hideNavigation&&this.navigation.tween(0)},onPrevClick:function(a){a.preventDefault();this.prev()},onNextClick:function(a){a.preventDefault();this.next()},onCloseClick:function(a){a.preventDefault();this.hide()},show:function(){this.container.show()},
hide:function(){this.container.hide()},load:function(a){var b=this.images[a].src||this.sourceImages[a];this.totalImages=this.images.length;this.prevBtn.removeClass("btn_disabled");this.nextBtn.removeClass("btn_disabled");this.loadedImages.contains(a)?this.setSource(b,a):new Asset.image(b,{onComplete:function(){this.loadedImages.push(a);this.setSource(b)}.bind(this)});this.options.loop||(0===a?this.prevBtn.addClass("btn_disabled"):a===this.totalImages-1&&this.nextBtn.addClass("btn_disabled"));this.currentIndex=
a;this.fireEvent("onChange",a)},prev:function(){this.currentIndex--;0>this.currentIndex?this.options.loop?(this.currentIndex=this.images.length-1,this.load(this.currentIndex)):this.currentIndex=0:this.load(this.currentIndex)},next:function(){this.currentIndex++;this.currentIndex>=this.images.length?this.options.loop?(this.currentIndex=0,this.load(this.currentIndex)):this.currentIndex=this.images.length-1:this.load(this.currentIndex)}}),Brozar=new Class({Implements:[Options,Events],options:{url:null,
thumbnailWidth:180,widthBuffer:110,onClipSelected:function(){}},cache:new Hash,pageNumber:1,itemsPerPage:10,itemOffset:null,scrollDirection:null,scrollActive:!1,RESIZE_UPDATE_INTERVAL:500,initialize:function(a,b){this.container=$(a);if(null===this.container)throw Error("Invalid element");this.setOptions(b);this.attachEvents();this.itemsPerPage=this.calculateItemsPerPage();this.lastWindowWidth=$(window).getSize().x;this.request=new Request.HTML({url:this.options.url,method:"get",onSuccess:function(a,
b,e){this.processHtml(e);this.cache.set(this.getKey(),e)}.bind(this)});this.loadPage(!0)},attachEvents:function(){this.bound={onWindowResize:this.onWindowResize.bind(this)};this.container.addEvent("click:relay(a)",this.onBrozarClick.bind(this))},calculateVisibleItemsPerPage:function(){var a=(this.container.getSize().x-this.options.widthBuffer)/this.options.thumbnailWidth;return 0.9this.itemsPerPage&&a.each(function(a,d){"left"===this.scrollDirection&&d>=b?a.destroy():"right"===this.scrollDirection&&d'+Copy.translate("count_comments",!1,{COUNT:1})+""):
null!==a&&(h=a.get("text").toInt()+1,a.set("text",Copy.translate("count_comments",1!==h,{COUNT:h})));Browser.ie&&7>=Browser.version?g.getElements("article").inject(j?c:b,j?"bottom":"before"):g.getElements("article").inject(j?c:b,j?"bottom":"before").setStyle("opacity",0).set("tween",{duration:250}).fade(1);Comment.resetForm(b)},onFailure:function(b){if(403===b.status)alert(Copy.dict.no_comments_for_you);else for(var c in JSON.decode(b.responseText))a.getElement(":input[name="+c+"]").addClass("validation-failed")}});
a.getElement(".guidelines")&&(a.getElement(".guidelines").removeEvents("click"),a.getElement(".guidelines").addEvent("click",function(a){a.stop();this.getParent("fieldset").getNext(".alert").toggle()}));Comment.setupUrlField(a)}},setupUrlField:function(a){a.getElements(".over-text").each(function(a){new OverText(a,{textOverride:a.get("data-placeholder")})})},resetUrlField:function(){OverText.update()},collapseReplyBoxes:function(){$$(".comment_reply").hide()},collapseCommentBox:function(){var a=$("comment");
a.getElement(".comment").isVisible()&&((new Element("a",{href:"#",html:Copy.translate("open_comment_box"),"class":"comment_toggle",events:{click:function(a){a.stop();Comment.openCommentBox();Comment.collapseReplyBoxes()}}})).inject(a),a.getElement(".comment").hide())},openCommentBox:function(){var a,b=$("comment");if(a=b.getElement(".comment_toggle"))b.getElement(".comment").show(),a.dispose(),Comment.resetUrlField.delay(50,this,[b])},setupAddReply:function(a,b){var c=$("comments"),d=b.getElement("form"),
c=c.getElements("."+a.get("id")+":not(.reply_form)").getLast(),e=a.get("id");Comment.resetForm(d);Comment.hideTools(a,"reply");b.toggle();Comment.collapseCommentBox();if(b.isDisplayed())if(b.getElement("textarea").focus(),new Form.Validator(d),"undefined"!==typeof Comment.reply_requests[e])Comment.reply_requests[e].target=c;else{var f=Comment.getContext(),g=f[0],f=f[1];Comment.reply_requests[e]=new Form.Request.Append(d,c,{extraData:{version:Global.getVersion(),token:vimeo.xsrft,context_type:g,context_id:f},
inject:"after",onBeforeEffect:function(){Comment.hideTools(a);b.toggle()},onSuccess:function(a){var b=$("count"),c;null!==b&&(c=b.get("text").toInt()+1,b.set("text",Copy.translate("count_comments",1!==c,{COUNT:c})));Comment.reply_requests[e].target=a;Comment.openCommentBox()},onFailure:function(a){if(403===a.status)alert(Copy.dict.no_comments_for_you);else for(var b in JSON.decode(a.responseText))d.getElement(":input[name="+b+"]").addClass("validation-failed")}})}Comment.resetUrlField(d)},setupEditComment:function(a){var b=
a.getElement(".comment_edit"),c=b.getElement("form"),d=a.getElement(".text");Comment.resetForm(c);Comment.hideTools(a,"edit");d.toggle();b.toggle();b.isDisplayed()&&(b.getElement("textarea").focus(),new Form.Validator(c),new Form.Request(c,a,{extraData:{token:vimeo.xsrft},onFailure:function(a){if(403===a.status)alert(Copy.dict.no_comments_for_you);else for(var b in JSON.decode(a.responseText))c.getElement(":input[name="+b+"]").addClass("validation-failed")}}))},setupDeleteComment:function(a){var b=
$("comments"),c=a.getElement(".comment_delete"),d=a.getElement(".text"),e=c.getElement("form");Comment.hideTools(a,"delete");d.show();c.toggle();c.isDisplayed()&&(c=Comment.getContext(),new Form.Request(e,null,{extraData:{token:vimeo.xsrft,context_type:c[0],context_id:c[1]},onSuccess:function(){var c=a,d=$("comments").getElement("h2"),e=$("count"),j=null!==e?e.get("text").toInt()-1:null;!a.hasClass("sticky")&&!a.hasClass("reply")&&(c=b.getElements("."+a.get("id")),c=(new Element("article",{"class":"main"})).surround(c));
c.get("dissolve").chain(function(){this.destroy()}.bind(c)).dissolve();0===j?d.set("html",Copy.dict.first_comment):null!==e&&e.set("text",Copy.translate("count_comments",1!==j,{COUNT:j}))}}))},onPermalinkClick:function(a){null!==window.location.hash.toString().match(/^#?\/?[0-9]+/)&&(a.stop(),Global.smoothScroll(this.get("href"),null,{set_hash:!0,full_href:!0}))},disableLoading:function(){var a=$("while_loading");a&&(a.getSiblings("a").hide(),a.show())},enableLoading:function(){var a=$("while_loading");
a&&(a.hide(),a.getSiblings("a").show())},onLoadSuccess:function(a,b,c){var a=$("pagination"),b=Elements.from(c),d={};if(a){b[0].hasClass("reply")&&a.getPrevious().hasClass("reply_form")&&a.getPrevious().destroy();1===Comment.page?($("comments").set("html",""),b.inject($("comments")),a.removeClass("hide"),Comment.page++):b.inject(a,"before");if(!c.contains("pagination"))for(;"comment"!==a.getNext().get("id");)a.getNext().destroy();a.destroy()}else d.last_page=!0;Signal.comments.request.success.dispatch(d);
Comment.enableLoading();window.Clip&&"undefined"!==typeof Clip.checkCommentHash&&Clip.checkCommentHash();Comment.setupAddComment()},onLoadRequest:function(){Comment.disableLoading()},onLoadMoreClick:function(a){a&&a.stop();if(this.hasClass("disabled"))return!1;Comment.pager=this;Comment.page=this.get("data-page");Comment.request.send({data:{action:"comments",page:Comment.page}})},onCommentOver:function(){var a;(a=this.getElement(".comment_tools"))&&a.show()},onCommentOut:function(){var a=!0,b;this.getElements(".tool").each(function(b){b.isDisplayed()&&
(a=!1)});!1!==a&&(b=this.getElement(".comment_tools"))&&b.hide()},onAction:function(a){var b,c;this.hasClass("reply")?(a.stop(),b=this.getParent(".article"),a=$(b.get("data-parent-id")),c=this.getNext(".comment_reply"),Comment.collapseReplyBoxes(),Comment.setupAddReply(a,c),Comment.setupUrlField(b)):this.hasClass("edit")?(a.stop(),Comment.setupEditComment(this.getParent(".article"))):this.hasClass("delete")?(a.stop(),Comment.setupDeleteComment(this.getParent(".article"))):this.hasClass("cancel")&&
(a.stop(),b=this.getParent("form"),a=this.getParent(".article").getElement(".text"),null!==a&&a.show(),b.getParent().hide(),Comment.openCommentBox())},onHashtagFound:function(a){var b=a.getNext(".reply_form");Global.smoothScroll(a);Comment.search.stop();b&&(a=b.get("data-parent-id"),Comment.setupAddReply($(a),b.getElement(".comment_reply")),Comment.collapseCommentBox())},onHashtagNotFound:function(){Comment.requests_made0 Likes
'+Copy.dict.loading+"
").show();Clip.adderRequest.send({url:ClipConfig.url})},loadStats:function(){var a=$("stats");Clip.infoElement.getElements(".video_more").each(function(a){"stats"!== a.get("id")&&a.hide()});a.set("html",''+Copy.dict.loading+"
").show();Clip.statsViewRequest.send({url:ClipConfig.url})},loadSubscribe:function(){Clip.subscribe_btn=Clip.subscribe_btn||$$("#tools #follow_btn")[0];var a=$("follow"),b=parseInt(Clip.subscribe_btn.get("data-subscribed"),10);Clip.subscribe_btn.set("data-subscribed",1-b);a.set("html",''+Copy.dict.loading+"
");b?Clip.subscribe_btn.removeClass("following").addClass("unfollowing"):(Clip.infoElement.getElements(".video_more").each(function(a){"follow"!== a.get("id")&&a.hide()}),a.show(),Clip.subscribe_btn.addClass("btn_disabled"));Clip.subscribeRequest.send({url:ClipConfig.user_url})},toggleCollection:function(){var a=this.get("data-type"),b=this.get("checked"),c=null;"remove_only"===this.get("data-permission")&&this.set("disabled",!0);(new Request.JSON({url:ClipConfig.url,method:"post",data:{action:"toggle_collection",type:a,id:this.get("value"),toggle:b?"add":"remove",token:vimeo.xsrft},onSuccess:function(d){d.success?(c=this.getParent(".col").getElement(".message"), clearTimeout(Clip.adderStatusMessageTweenTimer[a]),c.hide().removeClass(b?"red":"green").addClass(b?"green":"red").set("html",(b?Copy.dict.added:Copy.dict.removed)+"!").tween("opacity","1").setStyle("top",this.getPosition().y-c.getParent().getPosition().y-3+"px").show(),Clip.adderStatusMessageTweenTimer[a]=function(){c.tween("opacity",0)}.delay(3E3)):this.checked=!1;if("group_adds_limit_reached"===d.status){var e=$("groups");e.getElements("input:not(:checked)").each(function(a){a.getNext("label").addClass("disabled"); a.disabled=true;e.getElement("p.tip").removeClass("hidden")})}else"group_adds_limit_below"===d.status&&(e=$("groups"),e.getElements("input:disabled").each(function(a){a.getNext("label").removeClass("disabled");a.disabled=false}))}.bind(this)})).send()},onHistoryChange:function(a,b,c){""!==c.pathname&&(!History.hasPushState()&&!a&&(a=History.getPathName()),Clip.loadClip(a))},loadClip:function(a){Clip.playerRequest.send({data:{clip_id:a.split("/").getLast(),server:vimeo.url,context:"clip_page",action:"player"}}); Clip.infoRequest.send({url:a});Clip.downloadLoaded=!1;Clip.adderLoaded=!1;Clip.statsLoaded=!1},getFlickrs:function(){var a=[],b;(b=$("flickr_thumbnails"))&&b.getElements("img").each(function(b){a.push(b.get("data-large-image"))});return a},getPhotoUrls:function(){var a=[],b;(b=$("flickr_thumbnails"))&&b.getElements("img").each(function(b){a.push(b.get("data-pageurl"))});return a},setupFlickrGallery:function(a){var b=Clip.getFlickrs();b.length&&(Clip.photoPageUrls=Clip.getPhotoUrls(),Clip.gallery= new Gallery(a,b,{mainImage:a.getElement(".main_portrait"),canClose:!1,moveNextOnMain:!1,onChange:function(a){Clip.gallery.getMainImage().getParent("a").set("href",Clip.photoPageUrls[a])}}),$("flickr_thumbnails").getElements("img").each(function(a,b){a.addEvent("click",function(a){a.stop();Clip.gallery.load(b)})}))},goPrev:function(){Clip.brozar_loaded&&Cookie.write("stream",$("streams").get("data-stream"),{domain:vimeo.domain,path:"/"});Clip.navPrevRequest.send({url:ClipConfig.url})},goNext:function(){Clip.brozar_loaded&& Cookie.write("stream",$("streams").get("data-stream"),{domain:vimeo.domain,path:"/"});Clip.navNextRequest.send({url:ClipConfig.url})},removeClipCredit:function(a){a=a.getParent("li").get("id");confirm(Copy.dict.confirm_remove_credit)&&Clip.creditRequest.send({url:ClipConfig.url,data:{token:vimeo.xsrft,action:"toggle_clip_credits",credit_id:a}})},onDownloadClick:function(a){a.preventDefault();a=$("download");Clip.downloadLoaded?(Clip.infoElement.getElements(".video_more").each(function(a){"download"!== a.get("id")&&a.hide()}),$$("#tools .btn:not(.download)").removeClass("active"),$$("#tools .download").toggleClass("active"),a.toggle()):Clip.loadDownload()},onTipjarClick:function(a){a.preventDefault();a=$("tipjar");Clip.tipjarLoaded?(Clip.infoElement.getElements(".video_more").each(function(a){"tipjar"!==a.get("id")&&a.hide()}),$$("#tools .btn:not(.tipjar)").removeClass("active"),$$("#tools .tipjar").toggleClass("active"),a.toggle()):Clip.loadTipjar()},onAdderClick:function(a){a.preventDefault(); a=$("adder");Clip.adderLoaded?(Clip.infoElement.getElements(".video_more").each(function(a){"adder"!==a.get("id")&&a.hide()}),$$("#tools .btn:not(.adder)").removeClass("active"),$$("#tools .adder").toggleClass("active"),a.toggle()):Clip.loadAdder()},onStatsClick:function(a){a.preventDefault();a=$("stats");Clip.statsLoaded?(Clip.infoElement.getElements(".video_more").each(function(a){"stats"!==a.get("id")&&a.hide()}),$$("#tools .btn:not(.stats)").removeClass("active"),$$("#tools .stats").toggleClass("active"), a.toggle(),$("change_settings")&&Cookie.write("auto_load_stats",a.isVisible()?"1":"0",{domain:vimeo.domain,path:"/",duration:365})):(Cookie.write("auto_load_stats","1",{domain:vimeo.domain,path:"/",duration:365}),Clip.loadStats())},onSubscribeHover:function(a){Clip.subscribe_btn=Clip.subscribe_btn||$$("#tools #follow_btn")[0];!Clip.subscribe_btn.hasClass("active")&&!Clip.subscribing&&("mouseover"===a.type?Clip.subscribe_btn.set("html",Clip.subscribe_btn.get("data-hover-text")):Clip.subscribe_btn.set("html", Clip.subscribe_btn.get("data-btn-text")))},onSubscribeClick:function(a){a.preventDefault();Clip.subscribing||(Clip.subscribe_btn=Clip.subscribe_btn||$$("#tools #follow_btn")[0],$("follow"),parseInt(Clip.subscribe_btn.get("data-subscribed"),10),!Clip.subscribing&&!a.target.hasClass("active")?(Clip.subscribing=!0,Clip.loadSubscribe()):(Clip.subscribe_btn.removeClass("active").addClass("following").set("html",Clip.subscribe_btn.get("data-hover-text")),$("follow").hide(),Clip.subscribing=!1))},onDeleteClick:function(){if($$("#lightbox_container #lightbox_content #delete").length){var a= $("delete_form"),b=$("delete_error");new Form.Validator(a);var c=$("delete_submit_btn");new Form.Request(a,"delete_submit_btn",{requestOptions:{url:location.href},extraData:{action:"delete"},onSend:function(){b.set("html","")},onSuccess:function(a,b,c,g){location.href=JSON.decode(g)},onFailure:function(c){a.fireEvent("reset");a.getElement(":input[name=password]").addClass("validation-failed");b.set("html",JSON.decode(c.responseText).password)}});a.addEvent("keyup:relay(input[name=password])",function(a, b){""!==b.get("value")?c.set("disabled",!1):c.set("disabled",!0)})}},onPlayerSwitchClick:function(a){a.preventDefault();Cookie.write("html_player","html"===this.get("data-player-type")?1:0,{domain:vimeo.domain,path:"/",duration:365});Clip.loadClip(window.location.pathname)},onExtrasVisible:function(){Clip.extrasSpy.stop();Clip.extrasLoaded||Clip.loadExtras()},setupScrollCheck:function(){Clip.scrollCheck&&(Clip.scrollCheck.stop(),Clip.scrollCheck=null);Clip.scrollCheck=new ScrollSpy({min:205,onEnter:Clip.scrollEvent})}, addAdSpy:function(){var a=0;null!==Clip.brozar_element&&(a=Clip.brozar_element.getSize().y);var b=$("ad");null!==$("google_afc_ads")&&(Clip.adTextSpy=new ScrollSpy({min:$("google_afc_ads").getPosition().y-a-window.getSize().y,onEnter:Clip.adTextEvent}));null!==b&&(Clip.adSpy=new ScrollSpy({min:$("ad").getPosition().y-a-window.getSize().y,onEnter:Clip.adEvent}))},adEvent:function(){Clip.adSpy.stop();_gaq.push(["_trackEvent","scroll","ad_view","clip_page",void 0,!0])},adTextEvent:function(){Clip.adTextSpy.stop(); _gaq.push(["_trackEvent","scroll","text_ad_view","clip_page",void 0,!0])},scrollEvent:function(){Clip.scrollCheck.stop();_gaq.push(["_trackEvent","scroll","scroll","clip_page",void 0,!0])},onKeyboardShortcut:function(a){a&&History.push("/"+a)},onWindowResize:function(){var a=window.getHeight();a