var Froogaloop=function(){function f(a){return new f.fn.init(a)}function h(a,c,b){if(!b.contentWindow.postMessage)return!1;var d=b.getAttribute("src").split("?")[0];a=JSON.stringify({method:a,value:c});"//"===d.substr(0,2)&&(d=window.location.protocol+d);b.contentWindow.postMessage(a,d)}function l(a){try{var c=JSON.parse(a.data);var b=c.event||c.method}catch(p){}"ready"==b&&!k&&(k=!0);if(a.origin!=m)return!1;a=c.value;var d=c.data,g=""===g?null:c.player_id;c=g?e[g][b]:e[b];b=[];if(!c)return!1;void 0!==
a&&b.push(a);d&&b.push(d);g&&b.push(g);return 0<b.length?c.apply(null,b):c.call()}function n(a,c,b){b?(e[b]||(e[b]={}),e[b][a]=c):e[a]=c}var e={},k=!1,m="";f.fn=f.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;a=this.element.getAttribute("src");"//"===a.substr(0,2)&&(a=window.location.protocol+a);a=a.split("/");for(var c="",b=0,d=a.length;b<d;b++){if(3>b)c+=a[b];else break;2>b&&(c+="/")}m=c;return this},api:function(a,c){if(!this.element||
!a)return!1;var b=this.element,d=""!==b.id?b.id:null,e=c&&c.constructor&&c.call&&c.apply?null:c;(c=c&&c.constructor&&c.call&&c.apply?c:null)&&n(a,c,d);h(a,e,b);return this},addEvent:function(a,c){if(!this.element)return!1;var b=this.element,d=""!==b.id?b.id:null;n(a,c,d);"ready"!=a?h("addEventListener",a,b):"ready"==a&&k&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b;a:{if((b=""!==c.id?c.id:null)&&e[b]){if(!e[b][a]){b=!1;break a}e[b][a]=null}else{if(!e[a]){b=
!1;break a}e[a]=null}b=!0}"ready"!=a&&b&&h("removeEventListener",a,c)}};f.fn.init.prototype=f.fn;window.addEventListener?window.addEventListener("message",l,!1):window.attachEvent("onmessage",l);return window.Froogaloop=window.$f=f}();
