var Froogaloop=function(){var e={hasWindowEvent:false,PLAYER_DOMAIN:"",eventCallbacks:{},iframe_pattern:/player\.(([a-zA-Z0-9_\.]+)\.)?vimeo(ws)?\.com\/video\/([0-9]+)/i},j=function(b){b||(b=document.getElementsByTagName("iframe"));for(var a,c=0,f=b.length,g;c<f;c++){a=b[c];if(g=e.iframe_pattern.test(a.getAttribute("src"))){a.api=h.api;a.get=h.get;a.addEvent=h.addEvent}}},h={api:function(b,a){i(b,a,this)},get:function(b,a){k(b,a,this.id!=""?this.id:null);i(b,null,this)},addEvent:function(b,a){k(b,
a,this.id!=""?this.id:null);b!="onLoad"&&i("api_addEventListener",[b,a.name],this);if(e.hasWindowEvent)return false;e.PLAYER_DOMAIN=d.getDomainFromUrl(this.getAttribute("src"));window.addEventListener?window.addEventListener("message",l,false):window.attachEvent("onmessage",l,false);e.hasWindowEvent=true}},i=function(b,a,c){if(!c.contentWindow.postMessage)return false;if(a===undefined||a===null)a="";var f=c.getAttribute("src").split("?")[0];b=d.serialize({method:b,params:a,id:c.getAttribute("id")});
c.contentWindow.postMessage(b,f)},k=function(b,a,c){if(c){e.eventCallbacks[c]||(e.eventCallbacks[c]={});e.eventCallbacks[c][b]=a}else e.eventCallbacks[b]=a},l=function(b){if(b.origin!=e.PLAYER_DOMAIN)return false;var a=d.unserialize(b.data);b=a.params?a.params.split('"').join("").split(","):"";a=a.method;var c=b[b.length-1];if(c=="")c=null;if(a=c?e.eventCallbacks[c][a]:e.eventCallbacks[a])b.length>0?a.apply(null,b):a.call()},d={r20:/%20/g,isArray:function(b){return Object.prototype.toString.call(b)===
"[object Array]"},isFunction:function(b){return Object.prototype.toString.call(b)==="[object Function]"},unserialize:function(b){if(!b)return false;var a={};b=b.split("&");for(var c,f,g=0;g<b.length;g++){c=unescape(b[g].split("=")[0]);f=unescape(b[g].split("=")[1]);if(f.indexOf("=")>-1)f=d.unserialize(f);a[c]=f}return a},s:false,serialize:function(b){d.s=[];for(var a in b)d.buildParams(a,b[a]);return d.s.join("&").replace(d.r20,"+")},buildParams:function(b,a){var c=0;if(d.isArray(a)){for(;c<a.length;c++)a[c]=
encodeURIComponent(a[c]);d.addToParam(encodeURIComponent(b),a.join(","))}else d.addToParam(encodeURIComponent(b),encodeURIComponent(a))},addToParam:function(b,a){a=d.isFunction(a)?a():a;d.s[d.s.length]=b+"="+a},getDomainFromUrl:function(b){b=b.split("/");for(var a="",c=0;c<b.length;c++){if(c<3)a+=b[c];else break;if(c<2)a+="/"}return a}};j();return{init:j}}();
