/*!
 * Pusher JavaScript Library v1.5
 * 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 <http://gimite.net/en/>
 *   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 <http://code.google.com/p/swfobject/>
 *   is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 *
 * 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 c(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 c(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;l<B;l+=1)y[l]=d(l,o)||"null";s=y.length===0?"[]":j?"[\n"+j+y.join(",\n"+j)+"\n"+D+"]":"["+y.join(",")+"]";j=D;return s}if(m&&typeof m==="object"){B=m.length;for(l=0;l<B;l+=1){u=m[l];if(typeof u==="string")if(s=d(u,o))y.push(c(u)+(j?": ":":")+s)}}else for(u in o)if(Object.hasOwnProperty.call(o,u))if(s=d(u,o))y.push(c(u)+(j?": ":":")+s);s=y.length===0?"{}":j?"{\n"+j+y.join(",\n"+j)+"\n"+D+"}":"{"+y.join(",")+"}";
j=D;return s}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,j,t,x={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;if(typeof JSON.stringify!=="function")JSON.stringify=function(l,s,u){var B;t=j="";if(typeof u==="number")for(B=0;B<u;B+=1)t+=" ";else if(typeof u==="string")t=u;if((m=s)&&typeof s!=="function"&&(typeof s!=="object"||typeof s.length!=="number"))throw new Error("JSON.stringify");return d("",
{"":l})};if(typeof JSON.parse!=="function")JSON.parse=function(l,s){function u(B,D){var y,o,z=B[D];if(z&&typeof z==="object")for(y in z)if(Object.hasOwnProperty.call(z,y)){o=u(z,y);if(o!==undefined)z[y]=o;else delete z[y]}return s.call(B,D,z)}l=String(l);f.lastIndex=0;if(f.test(l))l=l.replace(f,function(B){return"\\u"+("0000"+B.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(l.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){l=eval("("+l+")");return typeof s==="function"?u({"":l},""):l}throw new SyntaxError("JSON.parse");}})();
var swfobject=function(){function a(){if(!K){try{var b=r.getElementsByTagName("body")[0].appendChild(z("span"));b.parentNode.removeChild(b)}catch(e){return}K=true;b=P.length;for(var g=0;g<b;g++)P[g]()}}function c(b){if(K)b();else P[P.length]=b}function d(b){if(typeof C.addEventListener!=v)C.addEventListener("load",b,false);else if(typeof r.addEventListener!=v)r.addEventListener("load",b,false);else if(typeof C.attachEvent!=v)fa(C,"onload",b);else if(typeof C.onload=="function"){var e=C.onload;C.onload=
function(){e();b()}}else C.onload=b}function f(){$?n():j()}function n(){var b=r.getElementsByTagName("body")[0],e=z(E);e.setAttribute("type",Q);var g=b.appendChild(e);if(g){var h=0;(function(){if(typeof g.GetVariable!=v){var i=g.GetVariable("$version");if(i){i=i.split(" ")[1].split(",");k.pv=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]}}else if(h<10){h++;setTimeout(arguments.callee,10);return}b.removeChild(e);g=null;j()})()}else j()}function j(){var b=H.length;if(b>0)for(var e=0;e<b;e++){var g=
H[e].id,h=H[e].callbackFn,i={success:false,id:g};if(k.pv[0]>0){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(b){var e=null;if((b=o(b))&&b.nodeName=="OBJECT")if(typeof b.SetVariable!=v)e=b;else if(b=b.getElementsByTagName(E)[0])e=b;return e}function x(){return!S&&R("6.0.65")&&(k.win||k.mac)&&!(k.wk&&k.wk<312)}function m(b,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}b.id=ba;if(typeof b.width==v||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==v||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.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(b,e,g)}}function l(b){if(k.ie&&k.win&&b.readyState!=4){var e=z("div");b.parentNode.insertBefore(e,b);e.parentNode.replaceChild(s(b),e);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(s(b),
b)}function s(b){var e=z("div");if(k.win&&k.ie)e.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(E)[0])if(b=b.childNodes)for(var g=b.length,h=0;h<g;h++)!(b[h].nodeType==1&&b[h].nodeName=="PARAM")&&b[h].nodeType!=8&&e.appendChild(b[h].cloneNode(true));return e}function u(b,e,g){var h,i=o(g);if(k.wk&&k.wk<312)return h;if(i){if(typeof b.id==v)b.id=g;if(k.ie&&k.win){var p="";for(var q in b)if(b[q]!=Object.prototype[q])if(q.toLowerCase()=="data")e.movie=b[q];else if(q.toLowerCase()=="styleclass")p+=
' class="'+b[q]+'"';else if(q.toLowerCase()!="classid")p+=" "+q+'="'+b[q]+'"';q="";for(var w in e)if(e[w]!=Object.prototype[w])q+='<param name="'+w+'" value="'+e[w]+'" />';i.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+p+">"+q+"</object>";U[U.length]=b.id;h=o(b.id)}else{w=z(E);w.setAttribute("type",Q);for(p in b)if(b[p]!=Object.prototype[p])if(p.toLowerCase()=="styleclass")w.setAttribute("class",b[p]);else p.toLowerCase()!="classid"&&w.setAttribute(p,b[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(b,e,g){var h=z("param");h.setAttribute("name",e);h.setAttribute("value",g);b.appendChild(h)}function D(b){var e=o(b);if(e&&e.nodeName=="OBJECT")if(k.ie&&k.win){e.style.display="none";(function(){e.readyState==4?y(b):setTimeout(arguments.callee,10)})()}else e.parentNode.removeChild(e)}function y(b){if(b=o(b)){for(var e in b)if(typeof b[e]=="function")b[e]=null;b.parentNode.removeChild(b)}}
function o(b){var e=null;try{e=r.getElementById(b)}catch(g){}return e}function z(b){return r.createElement(b)}function fa(b,e,g){b.attachEvent(e,g);M[M.length]=[b,e,g]}function R(b){var e=k.pv;b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return e[0]>b[0]||e[0]==b[0]&&e[1]>b[1]||e[0]==b[0]&&e[1]==b[1]&&e[2]>=b[2]?true:false}function ca(b,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(b,e);else F&&typeof r.createTextNode!=v&&F.appendChild(r.createTextNode(b+" {"+e+"}"))}}}function L(b,e){if(da){e=e?"visible":"hidden";if(K&&o(b))o(b).style.visibility=e;else ca("#"+b,"visibility:"+e)}}function ea(b){return/[\\\"<>\.;]/.exec(b)!=
null&&typeof encodeURIComponent!=v?encodeURIComponent(b):b}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 b=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:b,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(b){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 b=M.length,e=0;e<b;e++)M[e][0].detachEvent(M[e][1],M[e][2]);b=U.length;for(e=0;e<b;e++)D(U[e]);for(var g in k)k[g]=
null;k=null;for(var h in swfobject)swfobject[h]=null;swfobject=null})})();return{registerObject:function(b,e,g,h){if(k.w3&&b&&e){var i={};i.id=b;i.swfVersion=e;i.expressInstall=g;i.callbackFn=h;H[H.length]=i;L(b,false)}else h&&h({success:false,id:b})},getObjectById:function(b){if(k.w3)return t(b)},embedSWF:function(b,e,g,h,i,p,q,w,A,O){var V={success:false,id:e};if(k.w3&&!(k.wk&&k.wk<312)&&b&&e&&g&&h&&i){L(e,false);c(function(){g+="";h+="";var J={};if(A&&typeof A===E)for(var G in A)J[G]=A[G];J.data=
b;J.width=g;J.height=h;G={};if(w&&typeof w===E)for(var W in w)G[W]=w[W];if(q&&typeof q===E)for(var X in q)if(typeof G.flashvars!=v)G.flashvars+="&"+X+"="+q[X];else G.flashvars=X+"="+q[X];if(R(i)){W=u(J,G,e);J.id==e&&L(e,true);V.success=true;V.ref=W}else if(p&&x()){J.data=p;m(J,G,e,O);return}else L(e,true);O&&O(V)})}else O&&O(V)},switchOffAutoHideShow:function(){da=false},ua:k,getFlashPlayerVersion:function(){return{major:k.pv[0],minor:k.pv[1],release:k.pv[2]}},hasFlashPlayerVersion:R,createSWF:function(b,
e,g){if(k.w3)return u(b,e,g)},showExpressInstall:function(b,e,g,h){k.w3&&x()&&m(b,e,g,h)},removeSWF:function(b){k.w3&&D(b)},createCSS:function(b,e,g,h){k.w3&&ca(b,e,g,h)},addDomLoadEvent:c,addLoadEvent:d,getQueryParamValue:function(b){var e=r.location.search||r.location.hash;if(e){if(/\?/.test(e))e=e.split("?")[1];if(b==null)return ea(e);e=e.split("&");for(var g=0;g<e.length;g++)if(e[g].substring(0,e[g].indexOf("="))==b)return ea(e[g].substring(e[g].indexOf("=")+1))}return""},expressInstallCallback:function(){if(S){var b=
o(ba);if(b&&N){b.parentNode.replaceChild(N,b);if(T){L(T,true);if(k.ie&&k.win)N.style.display="block"}Y&&Y(aa)}S=false}}}}();function FABridge(a,c){this.target=a;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=FABridge.nextBridgeID++;this.name=c;this.nextLocalFuncID=0;FABridge.instances[this.name]=this;FABridge.idMap[this.bridgeID]=this;return this}FABridge.TYPE_ASINSTANCE=1;FABridge.TYPE_ASFUNCTION=2;
FABridge.TYPE_JSFUNCTION=3;FABridge.TYPE_ANONYMOUS=4;FABridge.initCallbacks={};FABridge.userTypes={};FABridge.addToUserTypes=function(){for(var a=0;a<arguments.length;a++)FABridge.userTypes[arguments[a]]={typeName:arguments[a],enriched:false}};FABridge.argsToArray=function(a){for(var c=[],d=0;d<a.length;d++)c[d]=a[d];return c};function instanceFactory(a){this.fb_instance_id=a;return this}
function FABridge__invokeJSFunction(a){var c=a[0];a=a.concat();a.shift();return FABridge.extractBridgeFromID(c).invokeLocalFunction(c,a)}FABridge.addInitializationCallback=function(a,c){var d=FABridge.instances[a];if(d!=undefined)c.call(d);else{d=FABridge.initCallbacks[a];if(d==null)FABridge.initCallbacks[a]=d=[];d.push(c)}};
function FABridge__bridgeInitialized(a){var c=document.getElementsByTagName("object"),d=c.length,f=[];if(d>0)for(var n=0;n<d;n++)if(typeof c[n].SetVariable!="undefined")f[f.length]=c[n];d=document.getElementsByTagName("embed");n=d.length;c=[];if(n>0)for(var j=0;j<n;j++)if(typeof d[j].SetVariable!="undefined")c[c.length]=d[j];j=f.length;d=c.length;n="bridgeName="+a;if(j==1&&!d||j==1&&d==1)FABridge.attachBridge(f[0],a);else if(d==1&&!j)FABridge.attachBridge(c[0],a);else{var t=false;if(j>1)for(var x=
0;x<j;x++){for(var m=f[x].childNodes,l=0;l<m.length;l++){var s=m[l];if(s.nodeType==1&&s.tagName.toLowerCase()=="param"&&s.name.toLowerCase()=="flashvars"&&s.value.indexOf(n)>=0){FABridge.attachBridge(f[x],a);t=true;break}}if(t)break}if(!t&&d>1)for(f=0;f<d;f++)if(c[f].attributes.getNamedItem("flashVars").nodeValue.indexOf(n)>=0){FABridge.attachBridge(c[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,c){a=new FABridge(a,c);FABridge[c]=a;var d=FABridge.initCallbacks[c];if(d!=null){for(var f=0;f<d.length;f++)d[f].call(a);delete FABridge.initCallbacks[c]}};FABridge.blockedMethods={toString:true,get:true,set:true,call:true};
FABridge.prototype={root:function(){return this.deserialize(this.target.getRoot())},releaseASObjects:function(){return this.target.releaseASObjects()},releaseNamedASObject:function(a){return typeof a!="object"?false:this.target.releaseNamedASObject(a.fb_instance_id)},create:function(a){return this.deserialize(this.target.create(a))},makeID:function(a){return(this.bridgeID<<16)+a},getPropertyFromAS:function(a,c){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.getPropFromAS(a,c);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},setPropertyInAS:function(a,c,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,c,this.serialize(d));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},
callASFunction:function(a,c){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(c));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},callASMethod:function(a,c,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,c,d);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},invokeLocalFunction:function(a,c){var d;a=this.localFunctionCache[a];if(a!=undefined)d=this.serialize(a.apply(null,this.deserialize(c)));return d},getTypeFromName:function(a){return this.remoteTypeCache[a]},createProxy:function(a,c){c=this.getTypeFromName(c);instanceFactory.prototype=c;c=new instanceFactory(a);return this.remoteInstanceCache[a]=
c},getProxy:function(a){return this.remoteInstanceCache[a]},addTypeDataToCache:function(a){newType=new ASProxy(this,a.name);for(var c=a.accessors,d=0;d<c.length;d++)this.addPropertyToType(newType,c[d]);a=a.methods;for(d=0;d<a.length;d++)FABridge.blockedMethods[a[d]]==undefined&&this.addMethodToType(newType,a[d]);return this.remoteTypeCache[newType.typeName]=newType},addPropertyToType:function(a,c){var d=c.charAt(0),f;if(d>="a"&&d<="z"){f="get"+d.toUpperCase()+c.substr(1);d="set"+d.toUpperCase()+c.substr(1)}else{f=
"get"+c;d="set"+c}a[d]=function(n){this.bridge.setPropertyInAS(this.fb_instance_id,c,n)};a[f]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,c))}},addMethodToType:function(a,c){a[c]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,c,FABridge.argsToArray(arguments)))}},getFunctionProxy:function(a){var c=this;if(this.remoteFunctionCache[a]==null)this.remoteFunctionCache[a]=function(){c.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 c={},d=typeof a;if(d=="number"||d=="string"||d=="boolean"||d==null||d==undefined)c=a;else if(a instanceof Array){c=[];for(d=0;d<a.length;d++)c[d]=this.serialize(a[d])}else if(d=="function"){c.type=FABridge.TYPE_JSFUNCTION;c.value=this.getFunctionID(a)}else if(a instanceof
ASProxy){c.type=FABridge.TYPE_ASINSTANCE;c.value=a.fb_instance_id}else{c.type=FABridge.TYPE_ANONYMOUS;c.value=a}return c},deserialize:function(a){var c,d=typeof a;if(d=="number"||d=="string"||d=="boolean"||a==null||a==undefined)c=this.handleError(a);else if(a instanceof Array){c=[];for(d=0;d<a.length;d++)c[d]=this.deserialize(a[d])}else if(d=="object"){for(d=0;d<a.newTypes.length;d++)this.addTypeDataToCache(a.newTypes[d]);for(var f in a.newRefs)this.createProxy(f,a.newRefs[f]);if(a.type==FABridge.TYPE_PRIMITIVE)c=
a.value;else if(a.type==FABridge.TYPE_ASFUNCTION)c=this.getFunctionProxy(a.value);else if(a.type==FABridge.TYPE_ASINSTANCE)c=this.getProxy(a.value);else if(a.type==FABridge.TYPE_ANONYMOUS)c=a.value}return c},addRef:function(a){this.target.incRef(a.fb_instance_id)},release:function(a){this.target.releaseRef(a.fb_instance_id)},handleError:function(a){if(typeof a=="string"&&a.indexOf("__FLASHERROR")==0){a=a.split("||");FABridge.refCount>0&&FABridge.refCount--;throw new Error(a[1]);}else return a}};
ASProxy=function(a,c){this.bridge=a;this.typeName=c;return this};ASProxy.prototype={get:function(a){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,a))},set:function(a,c){this.bridge.setPropertyInAS(this.fb_instance_id,a,c)},call:function(a,c){this.bridge.callASMethod(this.fb_instance_id,a,c)},addRef:function(){this.bridge.addRef(this)},release:function(){this.bridge.release(this)}};WEB_SOCKET_SWF_LOCATION="http://js.pusherapp.com/1.5/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 c(){}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<j;++n){this.__events[f.type][n](f);if(f.cancelBubble)break}false!==f.returnValue&&"function"==typeof this.__events[f.type].defaultHandler&&
this.__events[f.type].defaultHandler(f)};WebSocket.prototype.__handleMessages=function(){for(var f=this.__flash.readSocketData(),n=0;n<f.length;n++){var j=decodeURIComponent(f[n]);try{if(this.onmessage){var t;if(window.MessageEvent){t=document.createEvent("MessageEvent");t.initMessageEvent("message",false,false,j,null,null,window,null)}else t={data:j};this.onmessage(t)}}catch(x){d.error(x.toString())}}};WebSocket.prototype.__createEventHandler=function(f,n){return function(j){var t=new c;t.initEvent(n,
true,true);t.target=t.currentTarget=f;for(var x in j)t[x]=j[x];f.dispatchEvent(t,arguments)}};c.prototype.cancelable=true;c.prototype.cancelBubble=false;c.prototype.preventDefault=function(){if(this.cancelable)this.returnValue=false};c.prototype.stopPropagation=function(){this.cancelBubble=true};c.prototype.initEvent=function(f,n,j){this.type=f;this.cancelable=j;this.timeStamp=new Date};WebSocket.CONNECTING=0;WebSocket.OPEN=1;WebSocket.CLOSING=2;WebSocket.CLOSED=3;WebSocket.__tasks=[];WebSocket.__initialize=
function(){if(WebSocket.__swfLocation)window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation;if(window.WEB_SOCKET_SWF_LOCATION){var f=document.createElement("div");f.id="webSocketContainer";f.style.position="absolute";f.style.left="-100px";f.style.top="-100px";var n=document.createElement("div");n.id="webSocketFlash";f.appendChild(n);document.body.appendChild(f);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","8","8","9.0.0",null,{bridgeName:"webSocket"},{allowScriptAccess:"always"},null,
function(j){j.success||d.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var j=0;j<WebSocket.__tasks.length;++j)WebSocket.__tasks[j]();WebSocket.__tasks=[]}catch(t){d.error("[WebSocket] "+t.toString())}})}else d.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")};
WebSocket.__addTask=function(f){WebSocket.__flash?f():WebSocket.__tasks.push(f)};window.webSocketLog=function(f){d.log(decodeURIComponent(f))};window.webSocketError=function(f){d.error(decodeURIComponent(f))};window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",WebSocket.__initialize))}else d.error("Flash Player is not installed.")}})();
var Pusher=function(a,c){this.path="/app/"+a;this.key=a;this.channels=new Pusher.Channels;this.global_channel=new Pusher.Channel;this.global_channel.global=true;this.connected=this.secure=false;this.retry_counter=0;this.connect();c&&this.subscribe(c);var d=this;this.bind("pusher:connection_established",function(f){d.connected=true;d.retry_counter=0;d.socket_id=f.socket_id;d.subscribeAll()});this.bind("pusher:error",function(f){Pusher.log("Pusher : error : "+f.message)})};
Pusher.prototype={channel:function(a){return this.channels.find(a)},connect:function(){var a="ws://"+Pusher.host+":"+Pusher.ws_port+this.path;if(this.secure==true)a="wss://"+Pusher.host+":"+Pusher.wss_port+this.path;Pusher.allow_reconnect=true;Pusher.log("Pusher : connecting : "+a);var c=this;if(window.WebSocket){this.connection=new WebSocket(a);this.connection.onmessage=function(){c.onmessage.apply(c,arguments)};this.connection.onclose=function(){c.onclose.apply(c,arguments)};this.connection.onopen=
function(){c.onopen.apply(c,arguments)}}else{this.connection={};setTimeout(function(){c.send_local_event("pusher:connection_failed",{})},3E3)}},toggle_secure:function(){if(this.secure==false){this.secure=true;Pusher.log("Pusher: switching to wss:// connection")}else{this.secure=false;Pusher.log("Pusher: switching to ws:// connection")}},disconnect:function(){Pusher.log("Pusher : disconnecting");Pusher.allow_reconnect=false;Pusher.retry_count=0;this.connection.close()},bind:function(a,c){this.global_channel.bind(a,
c);return this},bind_all:function(a){this.global_channel.bind_all(a);return this},subscribeAll:function(){for(var a in this.channels.channels)this.channels.channels.hasOwnProperty(a)&&this.subscribe(a)},subscribe:function(a){var c=this.channels.add(a);if(this.connected)if(a.indexOf("private-")===0){var d=this,f=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");f.open("POST",Pusher.channel_auth_endpoint,true);f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
f.onreadystatechange=function(){if(f.readyState==4)if(f.status==200){var n=JSON.parse(f.responseText);d.trigger("pusher:subscribe",{channel:a,auth:n.auth})}else Pusher.log("Couldn't get auth info from your webapp"+status)};f.send("socket_id="+encodeURIComponent(this.socket_id)+"&channel_name="+encodeURIComponent(a))}else this.trigger("pusher:subscribe",{channel:a});return c},unsubscribe:function(a){this.channels.remove(a);this.connected&&this.trigger("pusher:unsubscribe",{channel:a})},trigger:function(a,
c){a=JSON.stringify({event:a,data:c,js_version:Pusher.VERSION});Pusher.log("Pusher : sending event : ",a);this.connection.send(a);return this},send_local_event:function(a,c,d){if(d){var f=this.channel(d);f&&f.dispatch_with_all(a,c)}this.global_channel.dispatch_with_all(a,c);Pusher.log("Pusher : event received : channel: "+d+"; event: "+a,c)},onmessage:function(a){a=JSON.parse(a.data);if(!(a.socket_id&&a.socket_id==this.socket_id)){var c=a.event,d=Pusher.parser(a.data);this.send_local_event(c,d,a.channel)}},
wait_and_reconnect:function(a,c){var d=this;setTimeout(function(){a();d.connect()},c)},onclose:function(){var a=this;this.global_channel.dispatch("close",null);Pusher.log("Pusher: Socket closed");var c=5E3;if(this.connected==true){this.send_local_event("pusher:connection_disconnected",{});if(Pusher.allow_reconnect){Pusher.log("Pusher : Reconnecting in 5 seconds...");this.wait_and_reconnect(function(){},c)}}else{a.send_local_event("pusher:connection_failed",{});if(this.retry_counter==0)c=100;this.retry_counter+=
1;this.wait_and_reconnect(function(){a.toggle_secure()},c)}this.connected=false},onopen:function(){this.global_channel.dispatch("open",null)}};Pusher.VERSION="1.5.1";Pusher.host="ws.pusherapp.com";Pusher.ws_port=80;Pusher.wss_port=443;Pusher.channel_auth_endpoint="/pusher/auth";Pusher.log=function(){};Pusher.allow_reconnect=true;Pusher.parser=function(a){try{return JSON.parse(a)}catch(c){Pusher.log("Pusher : data attribute not valid JSON - you may wish to implement your own Pusher.parser");return a}};
Pusher.Channels=function(){this.channels={}};Pusher.Channels.prototype={add:function(a){var c=this.find(a);if(c)return c;else{c=new Pusher.Channel;return this.channels[a]=c}},find:function(a){return this.channels[a]},remove:function(a){delete this.channels[a]}};Pusher.Channel=function(){this.callbacks={};this.global_callbacks=[]};
Pusher.Channel.prototype={bind:function(a,c){this.callbacks[a]=this.callbacks[a]||[];this.callbacks[a].push(c);return this},bind_all:function(a){this.global_callbacks.push(a);return this},dispatch_with_all:function(a,c){this.dispatch(a,c);this.dispatch_global_callbacks(a,c)},dispatch:function(a,c){var d=this.callbacks[a];if(d)for(a=0;a<d.length;a++)d[a](c);else this.global||Pusher.log("Pusher : No callbacks for "+a)},dispatch_global_callbacks:function(a,c){for(var d=0;d<this.global_callbacks.length;d++)this.global_callbacks[d](a,
c)}};

