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