/*!
 * Pusher JavaScript Library v1.4
 * 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(i){return i<10?"0"+i:i}function c(i){g.lastIndex=0;return g.test(i)?'"'+i.replace(g,function(n){var t=w[n];return typeof t==="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'}function e(i,n){var t,z,D=m,y,o=n[i];if(o&&typeof o==="object"&&typeof o.toJSON==="function")o=o.toJSON(i);if(typeof x==="function")o=x.call(n,i,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";
m+=s;y=[];if(Object.prototype.toString.apply(o)==="[object Array]"){z=o.length;for(i=0;i<z;i+=1)y[i]=e(i,o)||"null";n=y.length===0?"[]":m?"[\n"+m+y.join(",\n"+m)+"\n"+D+"]":"["+y.join(",")+"]";m=D;return n}if(x&&typeof x==="object"){z=x.length;for(i=0;i<z;i+=1){t=x[i];if(typeof t==="string")if(n=e(t,o))y.push(c(t)+(m?": ":":")+n)}}else for(t in o)if(Object.hasOwnProperty.call(o,t))if(n=e(t,o))y.push(c(t)+(m?": ":":")+n);n=y.length===0?"{}":m?"{\n"+m+y.join(",\n"+m)+"\n"+D+"}":"{"+y.join(",")+"}";
m=D;return n}}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 j=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
g=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,m,s,w={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},x;if(typeof JSON.stringify!=="function")JSON.stringify=function(i,n,t){var z;s=m="";if(typeof t==="number")for(z=0;z<t;z+=1)s+=" ";else if(typeof t==="string")s=t;if((x=n)&&typeof n!=="function"&&(typeof n!=="object"||typeof n.length!=="number"))throw new Error("JSON.stringify");return e("",
{"":i})};if(typeof JSON.parse!=="function")JSON.parse=function(i,n){function t(z,D){var y,o,A=z[D];if(A&&typeof A==="object")for(y in A)if(Object.hasOwnProperty.call(A,y)){o=t(A,y);if(o!==undefined)A[y]=o;else delete A[y]}return n.call(z,D,A)}i=String(i);j.lastIndex=0;if(j.test(i))i=i.replace(j,function(z){return"\\u"+("0000"+z.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(i.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){i=eval("("+i+")");return typeof n==="function"?t({"":i},""):i}throw new SyntaxError("JSON.parse");}})();
var swfobject=function(){function a(){if(!K){try{var b=r.getElementsByTagName("body")[0].appendChild(A("span"));b.parentNode.removeChild(b)}catch(d){return}K=true;b=P.length;for(var f=0;f<b;f++)P[f]()}}function c(b){if(K)b();else P[P.length]=b}function e(b){if(typeof C.addEventListener!=u)C.addEventListener("load",b,false);else if(typeof r.addEventListener!=u)r.addEventListener("load",b,false);else if(typeof C.attachEvent!=u)fa(C,"onload",b);else if(typeof C.onload=="function"){var d=C.onload;C.onload=
function(){d();b()}}else C.onload=b}function j(){$?g():m()}function g(){var b=r.getElementsByTagName("body")[0],d=A(E);d.setAttribute("type",Q);var f=b.appendChild(d);if(f){var h=0;(function(){if(typeof f.GetVariable!=u){var k=f.GetVariable("$version");if(k){k=k.split(" ")[1].split(",");l.pv=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}else if(h<10){h++;setTimeout(arguments.callee,10);return}b.removeChild(d);f=null;m()})()}else m()}function m(){var b=H.length;if(b>0)for(var d=0;d<b;d++){var f=
H[d].id,h=H[d].callbackFn,k={success:false,id:f};if(l.pv[0]>0){var p=o(f);if(p)if(R(H[d].swfVersion)&&!(l.wk&&l.wk<312)){L(f,true);if(h){k.success=true;k.ref=s(f);h(k)}}else if(H[d].expressInstall&&w()){k={};k.data=H[d].expressInstall;k.width=p.getAttribute("width")||"0";k.height=p.getAttribute("height")||"0";if(p.getAttribute("class"))k.styleclass=p.getAttribute("class");if(p.getAttribute("align"))k.align=p.getAttribute("align");var q={};p=p.getElementsByTagName("param");for(var v=p.length,B=0;B<
v;B++)if(p[B].getAttribute("name").toLowerCase()!="movie")q[p[B].getAttribute("name")]=p[B].getAttribute("value");x(k,q,f,h)}else{i(p);h&&h(k)}}else{L(f,true);if(h){if((f=s(f))&&typeof f.SetVariable!=u){k.success=true;k.ref=f}h(k)}}}}function s(b){var d=null;if((b=o(b))&&b.nodeName=="OBJECT")if(typeof b.SetVariable!=u)d=b;else if(b=b.getElementsByTagName(E)[0])d=b;return d}function w(){return!S&&R("6.0.65")&&(l.win||l.mac)&&!(l.wk&&l.wk<312)}function x(b,d,f,h){S=true;Y=h||null;aa={success:false,
id:f};var k=o(f);if(k){if(k.nodeName=="OBJECT"){N=n(k);T=null}else{N=k;T=f}b.id=ba;if(typeof b.width==u||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==u||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";r.title=r.title.slice(0,47)+" - Flash Player Installation";h=l.ie&&l.win?"ActiveX":"PlugIn";h="MMredirectURL="+C.location.toString().replace(/&/g,"%26")+"&MMplayerType="+h+"&MMdoctitle="+r.title;if(typeof d.flashvars!=u)d.flashvars+="&"+h;else d.flashvars=
h;if(l.ie&&l.win&&k.readyState!=4){h=A("div");f+="SWFObjectNew";h.setAttribute("id",f);k.parentNode.insertBefore(h,k);k.style.display="none";(function(){k.readyState==4?k.parentNode.removeChild(k):setTimeout(arguments.callee,10)})()}t(b,d,f)}}function i(b){if(l.ie&&l.win&&b.readyState!=4){var d=A("div");b.parentNode.insertBefore(d,b);d.parentNode.replaceChild(n(b),d);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(n(b),
b)}function n(b){var d=A("div");if(l.win&&l.ie)d.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(E)[0])if(b=b.childNodes)for(var f=b.length,h=0;h<f;h++)!(b[h].nodeType==1&&b[h].nodeName=="PARAM")&&b[h].nodeType!=8&&d.appendChild(b[h].cloneNode(true));return d}function t(b,d,f){var h,k=o(f);if(l.wk&&l.wk<312)return h;if(k){if(typeof b.id==u)b.id=f;if(l.ie&&l.win){var p="";for(var q in b)if(b[q]!=Object.prototype[q])if(q.toLowerCase()=="data")d.movie=b[q];else if(q.toLowerCase()=="styleclass")p+=
' class="'+b[q]+'"';else if(q.toLowerCase()!="classid")p+=" "+q+'="'+b[q]+'"';q="";for(var v in d)if(d[v]!=Object.prototype[v])q+='<param name="'+v+'" value="'+d[v]+'" />';k.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+p+">"+q+"</object>";U[U.length]=b.id;h=o(b.id)}else{v=A(E);v.setAttribute("type",Q);for(p in b)if(b[p]!=Object.prototype[p])if(p.toLowerCase()=="styleclass")v.setAttribute("class",b[p]);else p.toLowerCase()!="classid"&&v.setAttribute(p,b[p]);for(var B in d)d[B]!=
Object.prototype[B]&&B.toLowerCase()!="movie"&&z(v,B,d[B]);k.parentNode.replaceChild(v,k);h=v}}return h}function z(b,d,f){var h=A("param");h.setAttribute("name",d);h.setAttribute("value",f);b.appendChild(h)}function D(b){var d=o(b);if(d&&d.nodeName=="OBJECT")if(l.ie&&l.win){d.style.display="none";(function(){d.readyState==4?y(b):setTimeout(arguments.callee,10)})()}else d.parentNode.removeChild(d)}function y(b){if(b=o(b)){for(var d in b)if(typeof b[d]=="function")b[d]=null;b.parentNode.removeChild(b)}}
function o(b){var d=null;try{d=r.getElementById(b)}catch(f){}return d}function A(b){return r.createElement(b)}function fa(b,d,f){b.attachEvent(d,f);M[M.length]=[b,d,f]}function R(b){var d=l.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 d[0]>b[0]||d[0]==b[0]&&d[1]>b[1]||d[0]==b[0]&&d[1]==b[1]&&d[2]>=b[2]?true:false}function ca(b,d,f,h){if(!(l.ie&&l.mac)){var k=r.getElementsByTagName("head")[0];if(k){f=f&&typeof f=="string"?f:"screen";if(h)Z=F=null;
if(!F||Z!=f){h=A("style");h.setAttribute("type","text/css");h.setAttribute("media",f);F=k.appendChild(h);if(l.ie&&l.win&&typeof r.styleSheets!=u&&r.styleSheets.length>0)F=r.styleSheets[r.styleSheets.length-1];Z=f}if(l.ie&&l.win)F&&typeof F.addRule==E&&F.addRule(b,d);else F&&typeof r.createTextNode!=u&&F.appendChild(r.createTextNode(b+" {"+d+"}"))}}}function L(b,d){if(da){d=d?"visible":"hidden";if(K&&o(b))o(b).style.visibility=d;else ca("#"+b,"visibility:"+d)}}function ea(b){return/[\\\"<>\.;]/.exec(b)!=
null&&typeof encodeURIComponent!=u?encodeURIComponent(b):b}var u="undefined",E="object",Q="application/x-shockwave-flash",ba="SWFObjectExprInst",C=window,r=document,I=navigator,$=false,P=[j],H=[],U=[],M=[],N,T,Y,aa,K=false,S=false,F,Z,da=true,l=function(){var b=typeof r.getElementById!=u&&typeof r.getElementsByTagName!=u&&typeof r.createElement!=u,d=I.userAgent.toLowerCase(),f=I.platform.toLowerCase(),h=f?/win/.test(f):/win/.test(d);f=f?/mac/.test(f):/mac/.test(d);d=/webkit/.test(d)?parseFloat(d.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):false;var k=!+"\u000b1",p=[0,0,0],q=null;if(typeof I.plugins!=u&&typeof I.plugins["Shockwave Flash"]==E){if((q=I.plugins["Shockwave Flash"].description)&&!(typeof I.mimeTypes!=u&&I.mimeTypes[Q]&&!I.mimeTypes[Q].enabledPlugin)){$=true;k=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!=u)try{var v=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(v)if(q=v.GetVariable("$version")){k=true;q=q.split(" ")[1].split(",");p=[parseInt(q[0],10),parseInt(q[1],10),parseInt(q[2],10)]}}catch(B){}return{w3:b,pv:p,wk:d,ie:k,win:h,mac:f}}();(function(){if(l.w3){if(typeof r.readyState!=u&&r.readyState=="complete"||typeof r.readyState==u&&(r.getElementsByTagName("body")[0]||r.body))a();if(!K){typeof r.addEventListener!=u&&r.addEventListener("DOMContentLoaded",a,false);if(l.ie&&l.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()}}()}l.wk&&function(){K||(/loaded|complete/.test(r.readyState)?a():setTimeout(arguments.callee,0))}();e(a)}}})();(function(){l.ie&&l.win&&window.attachEvent("onunload",function(){for(var b=M.length,d=0;d<b;d++)M[d][0].detachEvent(M[d][1],M[d][2]);b=U.length;for(d=0;d<b;d++)D(U[d]);for(var f in l)l[f]=
null;l=null;for(var h in swfobject)swfobject[h]=null;swfobject=null})})();return{registerObject:function(b,d,f,h){if(l.w3&&b&&d){var k={};k.id=b;k.swfVersion=d;k.expressInstall=f;k.callbackFn=h;H[H.length]=k;L(b,false)}else h&&h({success:false,id:b})},getObjectById:function(b){if(l.w3)return s(b)},embedSWF:function(b,d,f,h,k,p,q,v,B,O){var V={success:false,id:d};if(l.w3&&!(l.wk&&l.wk<312)&&b&&d&&f&&h&&k){L(d,false);c(function(){f+="";h+="";var J={};if(B&&typeof B===E)for(var G in B)J[G]=B[G];J.data=
b;J.width=f;J.height=h;G={};if(v&&typeof v===E)for(var W in v)G[W]=v[W];if(q&&typeof q===E)for(var X in q)if(typeof G.flashvars!=u)G.flashvars+="&"+X+"="+q[X];else G.flashvars=X+"="+q[X];if(R(k)){W=t(J,G,d);J.id==d&&L(d,true);V.success=true;V.ref=W}else if(p&&w()){J.data=p;x(J,G,d,O);return}else L(d,true);O&&O(V)})}else O&&O(V)},switchOffAutoHideShow:function(){da=false},ua:l,getFlashPlayerVersion:function(){return{major:l.pv[0],minor:l.pv[1],release:l.pv[2]}},hasFlashPlayerVersion:R,createSWF:function(b,
d,f){if(l.w3)return t(b,d,f)},showExpressInstall:function(b,d,f,h){l.w3&&w()&&x(b,d,f,h)},removeSWF:function(b){l.w3&&D(b)},createCSS:function(b,d,f,h){l.w3&&ca(b,d,f,h)},addDomLoadEvent:c,addLoadEvent:e,getQueryParamValue:function(b){var d=r.location.search||r.location.hash;if(d){if(/\?/.test(d))d=d.split("?")[1];if(b==null)return ea(d);d=d.split("&");for(var f=0;f<d.length;f++)if(d[f].substring(0,d[f].indexOf("="))==b)return ea(d[f].substring(d[f].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(l.ie&&l.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=[],e=0;e<a.length;e++)c[e]=a[e];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 e=FABridge.instances[a];if(e!=undefined)c.call(e);else{e=FABridge.initCallbacks[a];if(e==null)FABridge.initCallbacks[a]=e=[];e.push(c)}};
function FABridge__bridgeInitialized(a){var c=document.getElementsByTagName("object"),e=c.length,j=[];if(e>0)for(var g=0;g<e;g++)if(typeof c[g].SetVariable!="undefined")j[j.length]=c[g];e=document.getElementsByTagName("embed");g=e.length;c=[];if(g>0)for(var m=0;m<g;m++)if(typeof e[m].SetVariable!="undefined")c[c.length]=e[m];m=j.length;e=c.length;g="bridgeName="+a;if(m==1&&!e||m==1&&e==1)FABridge.attachBridge(j[0],a);else if(e==1&&!m)FABridge.attachBridge(c[0],a);else{var s=false;if(m>1)for(var w=
0;w<m;w++){for(var x=j[w].childNodes,i=0;i<x.length;i++){var n=x[i];if(n.nodeType==1&&n.tagName.toLowerCase()=="param"&&n.name.toLowerCase()=="flashvars"&&n.value.indexOf(g)>=0){FABridge.attachBridge(j[w],a);s=true;break}}if(s)break}if(!s&&e>1)for(j=0;j<e;j++)if(c[j].attributes.getNamedItem("flashVars").nodeValue.indexOf(g)>=0){FABridge.attachBridge(c[j],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 e=FABridge.initCallbacks[c];if(e!=null){for(var j=0;j<e.length;j++)e[j].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,e){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(e));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,e){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++;e=this.serialize(e);retVal=this.target.invokeASMethod(a,c,e);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},invokeLocalFunction:function(a,c){var e;a=this.localFunctionCache[a];if(a!=undefined)e=this.serialize(a.apply(null,this.deserialize(c)));return e},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,e=0;e<c.length;e++)this.addPropertyToType(newType,c[e]);a=a.methods;for(e=0;e<a.length;e++)FABridge.blockedMethods[a[e]]==undefined&&this.addMethodToType(newType,a[e]);return this.remoteTypeCache[newType.typeName]=newType},addPropertyToType:function(a,c){var e=c.charAt(0),j;if(e>="a"&&e<="z"){j="get"+e.toUpperCase()+c.substr(1);e="set"+e.toUpperCase()+c.substr(1)}else{j=
"get"+c;e="set"+c}a[e]=function(g){this.bridge.setPropertyInAS(this.fb_instance_id,c,g)};a[j]=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={},e=typeof a;if(e=="number"||e=="string"||e=="boolean"||e==null||e==undefined)c=a;else if(a instanceof Array){c=[];for(e=0;e<a.length;e++)c[e]=this.serialize(a[e])}else if(e=="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,e=typeof a;if(e=="number"||e=="string"||e=="boolean"||a==null||a==undefined)c=this.handleError(a);else if(a instanceof Array){c=[];for(e=0;e<a.length;e++)c[e]=this.deserialize(a[e])}else if(e=="object"){for(e=0;e<a.newTypes.length;e++)this.addTypeDataToCache(a.newTypes[e]);for(var j in a.newRefs)this.createProxy(j,a.newRefs[j]);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)}};
(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(g){}return false}function c(g,m){return function(s){var w=new e;w.initEvent(m,true,true);w.target=w.currentTarget=g;for(var x in s)w[x]=s[x];g.dispatchEvent(w,arguments)}}function e(){}if(!window.WebSocket){var j=
window.console;j||(j={log:function(){},error:function(){}});if(a()){WebSocket=function(g,m,s,w,x){var i=this;i.readyState=WebSocket.CONNECTING;i.bufferedAmount=0;WebSocket.__addTask(function(){i.__flash=WebSocket.__flash.create(g,m,s||null,w||0,x||null);i.__flash.addEventListener("open",function(){try{i.onopen&&i.onopen()}catch(n){j.error(n.toString())}});i.__flash.addEventListener("close",function(){try{i.onclose&&i.onclose()}catch(n){j.error(n.toString())}});i.__flash.addEventListener("message",
function(n){n=decodeURIComponent(n.getData());try{if(i.onmessage){var t;if(window.MessageEvent){t=document.createEvent("MessageEvent");t.initMessageEvent("message",false,false,n,null,null,window)}else t={data:n};i.onmessage(t)}}catch(z){j.error(z.toString())}});i.__flash.addEventListener("stateChange",function(n){try{i.readyState=n.getReadyState();i.bufferedAmount=n.getBufferedAmount()}catch(t){j.error(t.toString())}})})};WebSocket.prototype.send=function(g){if(!this.__flash||this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";
g=this.__flash.send(g);if(g<0)return true;else{this.bufferedAmount=g;return false}};WebSocket.prototype.close=function(){if(this.__flash)if(this.readyState==WebSocket.OPEN){this.__flash.close();this.readyState=WebSocket.CLOSED;this.onclose&&this.onclose()}};WebSocket.prototype.addEventListener=function(g,m){if(!("__events"in this))this.__events={};if(!(g in this.__events)){this.__events[g]=[];if("function"==typeof this["on"+g]){this.__events[g].defaultHandler=this["on"+g];this["on"+g]=c(this,g)}}this.__events[g].push(m)};
WebSocket.prototype.removeEventListener=function(g,m){if(!("__events"in this))this.__events={};if(g in this.__events)for(var s=this.__events.length;s>-1;--s)if(m===this.__events[g][s]){this.__events[g].splice(s,1);break}};WebSocket.prototype.dispatchEvent=function(g){if(!("__events"in this))throw"UNSPECIFIED_EVENT_TYPE_ERR";if(!(g.type in this.__events))throw"UNSPECIFIED_EVENT_TYPE_ERR";for(var m=0,s=this.__events[g.type].length;m<s;++m){this.__events[g.type][m](g);if(g.cancelBubble)break}false!==
g.returnValue&&"function"==typeof this.__events[g.type].defaultHandler&&this.__events[g.type].defaultHandler(g)};e.prototype.cancelable=true;e.prototype.cancelBubble=false;e.prototype.preventDefault=function(){if(this.cancelable)this.returnValue=false};e.prototype.stopPropagation=function(){this.cancelBubble=true};e.prototype.initEvent=function(g,m,s){this.type=g;this.cancelable=s;this.timeStamp=new Date};WebSocket.CONNECTING=0;WebSocket.OPEN=1;WebSocket.CLOSED=2;WebSocket.__tasks=[];WebSocket.__initialize=
function(){if(WebSocket.__swfLocation){var g=document.createElement("div");g.id="webSocketContainer";g.style.position="absolute";g.style.left="-100px";g.style.top="-100px";var m=document.createElement("div");m.id="webSocketFlash";g.appendChild(m);document.body.appendChild(g);swfobject.embedSWF(WebSocket.__swfLocation,"webSocketFlash","8","8","9.0.0",null,{bridgeName:"webSocket"},null,null,function(s){s.success||j.error("[WebSocket] swfobject.embedSWF failed")});FABridge.addInitializationCallback("webSocket",
function(){try{WebSocket.__flash=FABridge.webSocket.root();WebSocket.__flash.setCallerUrl(location.href);for(var s=0;s<WebSocket.__tasks.length;++s)WebSocket.__tasks[s]();WebSocket.__tasks=[]}catch(w){j.error("[WebSocket] "+w.toString())}})}else j.error("[WebSocket] set WebSocket.__swfLocation to location of WebSocketMain.swf")};WebSocket.__addTask=function(g){WebSocket.__flash?g():WebSocket.__tasks.push(g)};window.addEventListener?window.addEventListener("load",WebSocket.__initialize,false):window.attachEvent("onload",
WebSocket.__initialize)}else j.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 e=this;this.bind("pusher:connection_established",function(j){e.connected=true;e.retry_counter=0;e.socket_id=j.socket_id;e.subscribeAll()});this.bind("pusher:error",function(j){Pusher.log("Pusher : error : "+j.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 e=this,j=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");j.open("POST",Pusher.channel_auth_endpoint,true);j.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
j.onreadystatechange=function(){if(j.readyState==4)if(j.status==200){var g=JSON.parse(j.responseText);e.trigger("pusher:subscribe",{channel:a,auth:g.auth})}else Pusher.log("Couldn't get auth info from your webapp"+status)};j.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});Pusher.log("Pusher : sending event : ",a);this.connection.send(a);return this},send_local_event:function(a,c,e){if(e){var j=this.channel(e);j&&j.dispatch_with_all(a,c)}this.global_channel.dispatch_with_all(a,c);Pusher.log("Pusher : event received : channel: "+e+"; 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,e=Pusher.parser(a.data);this.send_local_event(c,e,a.channel)}},wait_and_reconnect:function(a,
c){var e=this;setTimeout(function(){a();e.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.4.3";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 e=this.callbacks[a];if(e)for(a=0;a<e.length;a++)e[a](c);else this.global||Pusher.log("Pusher : No callbacks for "+a)},dispatch_global_callbacks:function(a,c){for(var e=0;e<this.global_callbacks.length;e++)this.global_callbacks[e](a,
c)}};
