var vimeoGAJS=window.vimeoGAJS?window.vimeoGAJS:{};!function(n){vimeoGAJS={iframes:[],gaTracker:void 0,eventMarker:{},init:function(){vimeoGAJS.iframes=n("iframe");n.each(vimeoGAJS.iframes,function(t,i){var r=n(i).attr("id");vimeoGAJS.eventMarker[r]={progress25:!1,progress50:!1,progress75:!1,videoPlayed:!1,videoPaused:!1,videoResumed:!1,videoSeeking:!1,videoCompleted:!1,timePercentComplete:0}});"function"==typeof ga&&(vimeoGAJS.gaTracker="ua");"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(vimeoGAJS.gaTracker="ga");"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(vimeoGAJS.gaTracker="gtm");window.addEventListener?window.addEventListener("message",vimeoGAJS.onMessageReceived,!1):window.attachEvent("onmessage",vimeoGAJS.onMessageReceived,!1)},onMessageReceived:function(t){if("http://player.vimeo.com"===t.origin.replace("https:","http:")&&"undefined"!=typeof vimeoGAJS.gaTracker){var u=JSON.parse(t.data),r=n("#"+u.player_id),i=r.attr("id");switch(u.event){case"ready":vimeoGAJS.onReady();break;case"playProgress":vimeoGAJS.onPlayProgress(u.data,r);break;case"seek":r.data("seek")&&!vimeoGAJS.eventMarker[i].videoSeeking&&(vimeoGAJS.sendEvent(r,"Skipped video forward or backward"),vimeoGAJS.eventMarker[i].videoSeeking=!0);break;case"play":vimeoGAJS.eventMarker[i].videoPlayed?!vimeoGAJS.eventMarker[i].videoResumed&&vimeoGAJS.eventMarker[i].videoPaused&&(vimeoGAJS.sendEvent(r,"Resumed video"),vimeoGAJS.eventMarker[i].videoResumed=!0):(vimeoGAJS.sendEvent(r,"Started video"),vimeoGAJS.eventMarker[i].videoPlayed=!0);break;case"pause":vimeoGAJS.onPause(r);break;case"finish":vimeoGAJS.eventMarker[i].videoCompleted||(vimeoGAJS.sendEvent(r,"Completed video"),vimeoGAJS.eventMarker[i].videoCompleted=!0)}}},getLabel:function(n){var i=n.attr("src").split("?")[0],t=i;return n.data("title")?t+=" ("+n.data("title")+")":n.attr("title")&&(t+=" ("+n.attr("title")+")"),t},post:function(t,i,r){var u={method:t},f;i&&(u.value=i);f=n(r).attr("src").split("?")[0];r.contentWindow.postMessage(JSON.stringify(u),f)},onReady:function(){n.each(vimeoGAJS.iframes,function(n,t){vimeoGAJS.post("addEventListener","play",t);vimeoGAJS.post("addEventListener","seek",t);vimeoGAJS.post("addEventListener","pause",t);vimeoGAJS.post("addEventListener","finish",t);vimeoGAJS.post("addEventListener","playProgress",t)})},onPause:function(n){var t=n.attr("id");vimeoGAJS.eventMarker[t].timePercentComplete<99&&!vimeoGAJS.eventMarker[t].videoPaused&&(vimeoGAJS.sendEvent(n,"Paused video"),vimeoGAJS.eventMarker[t].videoPaused=!0)},onPlayProgress:function(n,t){var r,i=t.attr("id");vimeoGAJS.eventMarker[i].timePercentComplete=Math.round(100*n.percent);t.data("progress")&&(vimeoGAJS.eventMarker[i].timePercentComplete>24&&!vimeoGAJS.eventMarker[i].progress25&&(r="Played video: 25%",vimeoGAJS.eventMarker[i].progress25=!0),vimeoGAJS.eventMarker[i].timePercentComplete>49&&!vimeoGAJS.eventMarker[i].progress50&&(r="Played video: 50%",vimeoGAJS.eventMarker[i].progress50=!0),vimeoGAJS.eventMarker[i].timePercentComplete>74&&!vimeoGAJS.eventMarker[i].progress75&&(r="Played video: 75%",vimeoGAJS.eventMarker[i].progress75=!0),r&&vimeoGAJS.sendEvent(t,r))},sendEvent:function(n,t){var i=n.data("bounce"),r=vimeoGAJS.getLabel(n);switch(vimeoGAJS.gaTracker){case"gtm":dataLayer.push({event:"Vimeo",eventCategory:"Vimeo",eventAction:t,eventLabel:r,eventValue:void 0,eventNonInteraction:i?!1:!0});break;case"ua":ga("send","event","Vimeo",t,r,void 0,{nonInteraction:i?0:1});break;case"ga":_gaq.push(["_trackEvent","Vimeo",t,r,void 0,i?!1:!0])}}};vimeoGAJS.init()}(jQuery)