/*!
* Pusher JavaScript Library v1.6.1
* http://pusherapp.com/
*
* Copyright 2010, New Bamboo
* Released under the MIT licence.
*/
/*
* This library contains code with the following licences:
*
* web_socket.js:
*
* Copyright: Hiroshi Ichikawa
* License: New BSD License
* Reference: http://dev.w3.org/html5/websockets/
* Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
*
* swfobject.js:
*
* SWFObject v2.2
* is released under the MIT License
*
* FABridge.js:
*
* Copyright 2006 Adobe Systems Incorporated
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
if(!this.JSON)this.JSON={};
(function(){function a(l){return l<10?"0"+l:l}function b(l){n.lastIndex=0;return n.test(l)?'"'+l.replace(n,function(s){var u=x[s];return typeof u==="string"?u:"\\u"+("0000"+s.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+l+'"'}function d(l,s){var u,B,D=j,y,o=s[l];if(o&&typeof o==="object"&&typeof o.toJSON==="function")o=o.toJSON(l);if(typeof m==="function")o=m.call(s,l,o);switch(typeof o){case "string":return b(o);case "number":return isFinite(o)?String(o):"null";case "boolean":case "null":return String(o);case "object":if(!o)return"null";
j+=t;y=[];if(Object.prototype.toString.apply(o)==="[object Array]"){B=o.length;for(l=0;l0)for(var e=0;e0){var p=o(g);if(p)if(R(H[e].swfVersion)&&!(k.wk&&k.wk<312)){L(g,true);if(h){i.success=true;i.ref=t(g);h(i)}}else if(H[e].expressInstall&&x()){i={};i.data=H[e].expressInstall;i.width=p.getAttribute("width")||"0";i.height=p.getAttribute("height")||"0";if(p.getAttribute("class"))i.styleclass=p.getAttribute("class");if(p.getAttribute("align"))i.align=p.getAttribute("align");var q={};p=p.getElementsByTagName("param");for(var w=p.length,A=0;A<
w;A++)if(p[A].getAttribute("name").toLowerCase()!="movie")q[p[A].getAttribute("name")]=p[A].getAttribute("value");m(i,q,g,h)}else{l(p);h&&h(i)}}else{L(g,true);if(h){if((g=t(g))&&typeof g.SetVariable!=v){i.success=true;i.ref=g}h(i)}}}}function t(c){var e=null;if((c=o(c))&&c.nodeName=="OBJECT")if(typeof c.SetVariable!=v)e=c;else if(c=c.getElementsByTagName(E)[0])e=c;return e}function x(){return!S&&R("6.0.65")&&(k.win||k.mac)&&!(k.wk&&k.wk<312)}function m(c,e,g,h){S=true;Y=h||null;aa={success:false,
id:g};var i=o(g);if(i){if(i.nodeName=="OBJECT"){N=s(i);T=null}else{N=i;T=g}c.id=ba;if(typeof c.width==v||!/%$/.test(c.width)&&parseInt(c.width,10)<310)c.width="310";if(typeof c.height==v||!/%$/.test(c.height)&&parseInt(c.height,10)<137)c.height="137";r.title=r.title.slice(0,47)+" - Flash Player Installation";h=k.ie&&k.win?"ActiveX":"PlugIn";h="MMredirectURL="+C.location.toString().replace(/&/g,"%26")+"&MMplayerType="+h+"&MMdoctitle="+r.title;if(typeof e.flashvars!=v)e.flashvars+="&"+h;else e.flashvars=
h;if(k.ie&&k.win&&i.readyState!=4){h=z("div");g+="SWFObjectNew";h.setAttribute("id",g);i.parentNode.insertBefore(h,i);i.style.display="none";(function(){i.readyState==4?i.parentNode.removeChild(i):setTimeout(arguments.callee,10)})()}u(c,e,g)}}function l(c){if(k.ie&&k.win&&c.readyState!=4){var e=z("div");c.parentNode.insertBefore(e,c);e.parentNode.replaceChild(s(c),e);c.style.display="none";(function(){c.readyState==4?c.parentNode.removeChild(c):setTimeout(arguments.callee,10)})()}else c.parentNode.replaceChild(s(c),
c)}function s(c){var e=z("div");if(k.win&&k.ie)e.innerHTML=c.innerHTML;else if(c=c.getElementsByTagName(E)[0])if(c=c.childNodes)for(var g=c.length,h=0;h';i.outerHTML='";U[U.length]=c.id;h=o(c.id)}else{w=z(E);w.setAttribute("type",Q);for(p in c)if(c[p]!=Object.prototype[p])if(p.toLowerCase()=="styleclass")w.setAttribute("class",c[p]);else p.toLowerCase()!="classid"&&w.setAttribute(p,c[p]);for(var A in e)e[A]!=
Object.prototype[A]&&A.toLowerCase()!="movie"&&B(w,A,e[A]);i.parentNode.replaceChild(w,i);h=w}}return h}function B(c,e,g){var h=z("param");h.setAttribute("name",e);h.setAttribute("value",g);c.appendChild(h)}function D(c){var e=o(c);if(e&&e.nodeName=="OBJECT")if(k.ie&&k.win){e.style.display="none";(function(){e.readyState==4?y(c):setTimeout(arguments.callee,10)})()}else e.parentNode.removeChild(e)}function y(c){if(c=o(c)){for(var e in c)if(typeof c[e]=="function")c[e]=null;c.parentNode.removeChild(c)}}
function o(c){var e=null;try{e=r.getElementById(c)}catch(g){}return e}function z(c){return r.createElement(c)}function fa(c,e,g){c.attachEvent(e,g);M[M.length]=[c,e,g]}function R(c){var e=k.pv;c=c.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return e[0]>c[0]||e[0]==c[0]&&e[1]>c[1]||e[0]==c[0]&&e[1]==c[1]&&e[2]>=c[2]?true:false}function ca(c,e,g,h){if(!(k.ie&&k.mac)){var i=r.getElementsByTagName("head")[0];if(i){g=g&&typeof g=="string"?g:"screen";if(h)Z=F=null;
if(!F||Z!=g){h=z("style");h.setAttribute("type","text/css");h.setAttribute("media",g);F=i.appendChild(h);if(k.ie&&k.win&&typeof r.styleSheets!=v&&r.styleSheets.length>0)F=r.styleSheets[r.styleSheets.length-1];Z=g}if(k.ie&&k.win)F&&typeof F.addRule==E&&F.addRule(c,e);else F&&typeof r.createTextNode!=v&&F.appendChild(r.createTextNode(c+" {"+e+"}"))}}}function L(c,e){if(da){e=e?"visible":"hidden";if(K&&o(c))o(c).style.visibility=e;else ca("#"+c,"visibility:"+e)}}function ea(c){return/[\\\"<>\.;]/.exec(c)!=
null&&typeof encodeURIComponent!=v?encodeURIComponent(c):c}var v="undefined",E="object",Q="application/x-shockwave-flash",ba="SWFObjectExprInst",C=window,r=document,I=navigator,$=false,P=[f],H=[],U=[],M=[],N,T,Y,aa,K=false,S=false,F,Z,da=true,k=function(){var c=typeof r.getElementById!=v&&typeof r.getElementsByTagName!=v&&typeof r.createElement!=v,e=I.userAgent.toLowerCase(),g=I.platform.toLowerCase(),h=g?/win/.test(g):/win/.test(e);g=g?/mac/.test(g):/mac/.test(e);e=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):false;var i=!+"\u000b1",p=[0,0,0],q=null;if(typeof I.plugins!=v&&typeof I.plugins["Shockwave Flash"]==E){if((q=I.plugins["Shockwave Flash"].description)&&!(typeof I.mimeTypes!=v&&I.mimeTypes[Q]&&!I.mimeTypes[Q].enabledPlugin)){$=true;i=false;q=q.replace(/^.*\s+(\S+\s+\S+$)/,"$1");p[0]=parseInt(q.replace(/^(.*)\..*$/,"$1"),10);p[1]=parseInt(q.replace(/^.*\.(.*)\s.*$/,"$1"),10);p[2]=/[a-zA-Z]/.test(q)?parseInt(q.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof C.ActiveXObject!=v)try{var w=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(w)if(q=w.GetVariable("$version")){i=true;q=q.split(" ")[1].split(",");p=[parseInt(q[0],10),parseInt(q[1],10),parseInt(q[2],10)]}}catch(A){}return{w3:c,pv:p,wk:e,ie:i,win:h,mac:g}}();(function(){if(k.w3){if(typeof r.readyState!=v&&r.readyState=="complete"||typeof r.readyState==v&&(r.getElementsByTagName("body")[0]||r.body))a();if(!K){typeof r.addEventListener!=v&&r.addEventListener("DOMContentLoaded",a,false);if(k.ie&&k.win){r.attachEvent("onreadystatechange",
function(){if(r.readyState=="complete"){r.detachEvent("onreadystatechange",arguments.callee);a()}});C==top&&function(){if(!K){try{r.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,0);return}a()}}()}k.wk&&function(){K||(/loaded|complete/.test(r.readyState)?a():setTimeout(arguments.callee,0))}();d(a)}}})();(function(){k.ie&&k.win&&window.attachEvent("onunload",function(){for(var c=M.length,e=0;e0)for(var n=0;n0)for(var j=0;j1)for(var x=
0;x=0){FABridge.attachBridge(f[x],a);t=true;break}}if(t)break}if(!t&&d>1)for(f=0;f=0){FABridge.attachBridge(b[f],a);break}}return true}FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;
FABridge.extractBridgeFromID=function(a){return FABridge.idMap[a>>16]};FABridge.attachBridge=function(a,b){a=new FABridge(a,b);FABridge[b]=a;var d=FABridge.initCallbacks[b];if(d!=null){for(var f=0;f0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
else{FABridge.refCount++;retVal=this.target.getPropFromAS(a,b);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},setPropertyInAS:function(a,b,d){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");else{FABridge.refCount++;retVal=this.target.setPropInAS(a,b,this.serialize(d));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},
callASFunction:function(a,b){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");else{FABridge.refCount++;retVal=this.target.invokeASFunction(a,this.serialize(b));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},callASMethod:function(a,b,d){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
else{FABridge.refCount++;d=this.serialize(d);retVal=this.target.invokeASMethod(a,b,d);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},invokeLocalFunction:function(a,b){var d;a=this.localFunctionCache[a];if(a!=undefined)d=this.serialize(a.apply(null,this.deserialize(b)));return d},getTypeFromName:function(a){return this.remoteTypeCache[a]},createProxy:function(a,b){b=this.getTypeFromName(b);instanceFactory.prototype=b;b=new instanceFactory(a);return this.remoteInstanceCache[a]=
b},getProxy:function(a){return this.remoteInstanceCache[a]},addTypeDataToCache:function(a){newType=new ASProxy(this,a.name);for(var b=a.accessors,d=0;d="a"&&d<="z"){f="get"+d.toUpperCase()+b.substr(1);d="set"+d.toUpperCase()+b.substr(1)}else{f=
"get"+b;d="set"+b}a[d]=function(n){this.bridge.setPropertyInAS(this.fb_instance_id,b,n)};a[f]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,b))}},addMethodToType:function(a,b){a[b]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,b,FABridge.argsToArray(arguments)))}},getFunctionProxy:function(a){var b=this;if(this.remoteFunctionCache[a]==null)this.remoteFunctionCache[a]=function(){b.callASFunction(a,FABridge.argsToArray(arguments))};
return this.remoteFunctionCache[a]},getFunctionID:function(a){if(a.__bridge_id__==undefined){a.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[a.__bridge_id__]=a}return a.__bridge_id__},serialize:function(a){var b={},d=typeof a;if(d=="number"||d=="string"||d=="boolean"||d==null||d==undefined)b=a;else if(a instanceof Array){b=[];for(d=0;d0&&FABridge.refCount--;throw new Error(a[1]);}else return a}};
ASProxy=function(a,b){this.bridge=a;this.typeName=b;return this};ASProxy.prototype={get:function(a){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,a))},set:function(a,b){this.bridge.setPropertyInAS(this.fb_instance_id,a,b)},call:function(a,b){this.bridge.callASMethod(this.fb_instance_id,a,b)},addRef:function(){this.bridge.addRef(this)},release:function(){this.bridge.release(this)}};WEB_SOCKET_SWF_LOCATION="http://js.pusherapp.com/1.6.1/WebSocketMain.swf";
(function(){function a(){if("navigator"in window&&"plugins"in navigator&&navigator.plugins["Shockwave Flash"])return!!navigator.plugins["Shockwave Flash"].description;if("ActiveXObject"in window)try{return!!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(f){}return false}function b(){}if(!window.WebSocket){var d=window.console;d||(d={log:function(){},error:function(){}});if(a()){d.log(location.protocol);location.protocol=="file:"&&d.error("web-socket-js doesn't work in file:///... URL (without special configuration). Open the page via Web server i.e. http://...");
WebSocket=function(f,n,j,t,x){var m=this;m.readyState=WebSocket.CONNECTING;m.bufferedAmount=0;setTimeout(function(){WebSocket.__addTask(function(){m.__createFlash(f,n,j,t,x)})},1)};WebSocket.prototype.__createFlash=function(f,n,j,t,x){var m=this;m.__flash=WebSocket.__flash.create(f,n,j||null,t||0,x||null);m.__flash.addEventListener("open",function(){try{m.readyState=m.__flash.getReadyState();m.__timer&&clearInterval(m.__timer);if(window.opera)m.__timer=setInterval(function(){m.__handleMessages()},
500);m.onopen&&m.onopen()}catch(l){d.error(l.toString())}});m.__flash.addEventListener("close",function(){try{m.readyState=m.__flash.getReadyState();m.__timer&&clearInterval(m.__timer);m.onclose&&m.onclose()}catch(l){d.error(l.toString())}});m.__flash.addEventListener("message",function(){try{m.__handleMessages()}catch(l){d.error(l.toString())}});m.__flash.addEventListener("error",function(){try{m.__timer&&clearInterval(m.__timer);m.onerror&&m.onerror()}catch(l){d.error(l.toString())}});m.__flash.addEventListener("stateChange",
function(l){try{m.readyState=m.__flash.getReadyState();m.bufferedAmount=l.getBufferedAmount()}catch(s){d.error(s.toString())}})};WebSocket.prototype.send=function(f){if(this.__flash)this.readyState=this.__flash.getReadyState();if(!this.__flash||this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";f=this.__flash.send(encodeURIComponent(f));if(f<0)return true;else{this.bufferedAmount=f;return false}};WebSocket.prototype.close=function(){if(this.__flash){this.readyState=
this.__flash.getReadyState();if(this.readyState==WebSocket.OPEN){this.__flash.close();this.readyState=WebSocket.CLOSED;this.__timer&&clearInterval(this.__timer);this.onclose&&this.onclose()}}};WebSocket.prototype.addEventListener=function(f,n){if(!("__events"in this))this.__events={};if(!(f in this.__events)){this.__events[f]=[];if("function"==typeof this["on"+f]){this.__events[f].defaultHandler=this["on"+f];this["on"+f]=this.__createEventHandler(this,f)}}this.__events[f].push(n)};WebSocket.prototype.removeEventListener=
function(f,n){if(!("__events"in this))this.__events={};if(f in this.__events)for(var j=this.__events.length;j>-1;--j)if(n===this.__events[f][j]){this.__events[f].splice(j,1);break}};WebSocket.prototype.dispatchEvent=function(f){if(!("__events"in this))throw"UNSPECIFIED_EVENT_TYPE_ERR";if(!(f.type in this.__events))throw"UNSPECIFIED_EVENT_TYPE_ERR";for(var n=0,j=this.__events[f.type].length;n