function FABridge(aa,ba){this.target=aa;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=FABridge.nextBridgeID++;this.name=ba;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 i=0;i<arguments.length;i++){FABridge.userTypes[arguments[i]]={'typeName':arguments[i],'enriched':false};}}
FABridge.argsToArray=function(ca){var da=[];for(var i=0;i<ca.length;i++){da[i]=ca[i];}
return da;}
function instanceFactory(ea){this.fb_instance_id=ea;return this;}
function FABridge__invokeJSFunction(fa){var ga=fa[0];var ha=fa.concat();ha.shift();var ia=FABridge.extractBridgeFromID(ga);return ia.invokeLocalFunction(ga,ha);}
FABridge.addInitializationCallback=function(ja,ka){var la=FABridge.instances[ja];if(la!=undefined){ka.call(la);return;}
var ma=FABridge.initCallbacks[ja];if(ma==null){FABridge.initCallbacks[ja]=ma=[];}
ma.push(ka);}
function FABridge__bridgeInitialized(na){var oa="bridgeName="+na;if(/Explorer/.test(navigator.appName)||/Konqueror|Safari|KHTML/.test(navigator.appVersion)){var pa=document.getElementsByTagName("object");if(pa.length==1){FABridge.attachBridge(pa[0],na);}
else{for(var i=0;i<pa.length;i++){var qa=pa[i];var ra=qa.childNodes;var sa=false;for(var j=0;j<ra.length;j++){var ta=ra[j];if(ta.nodeType==1&&ta.tagName.toLowerCase()=="param"){if(ta["name"].toLowerCase()=="flashvars"&&ta["value"].indexOf(oa)>=0){FABridge.attachBridge(qa,na);sa=true;break;}}}
if(sa){break;}}}}
else{var pa=document.getElementsByTagName("embed");if(pa.length==1){FABridge.attachBridge(pa[0],na);}
else{for(var i=0;i<pa.length;i++){var qa=pa[i];if(qa.attributes.getNamedItem("flashVars")){var ua=qa.attributes.getNamedItem("flashVars").nodeValue;if(ua.indexOf(oa)>=0){FABridge.attachBridge(qa,na);}}}}}
return true;}
FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;FABridge.extractBridgeFromID=function(id){var va=(id>>16);return FABridge.idMap[va];}
FABridge.attachBridge=function(wa,xa){var ya=new FABridge(wa,xa);FABridge[xa]=ya;var za=FABridge.initCallbacks[xa];if(za==null){return;}
for(var i=0;i<za.length;i++){za[i].call(ya);}
delete FABridge.initCallbacks[xa]}
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(Aa){if(typeof(Aa)!="object"){return false;}
else{var Ba=this.target.releaseNamedASObject(Aa.fb_instance_id);return Ba;}},create:function(Ca){return this.deserialize(this.target.create(Ca));},makeID:function(Da){return(this.bridgeID<<16)+Da;},getPropertyFromAS:function(Ea,Fa){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(Ea,Fa);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},setPropertyInAS:function(Ga,Ha,Ia){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(Ga,Ha,this.serialize(Ia));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASFunction:function(Ja,Ka){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(Ja,this.serialize(Ka));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASMethod:function(La,Ma,Na){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++;Na=this.serialize(Na);retVal=this.target.invokeASMethod(La,Ma,Na);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},invokeLocalFunction:function(Oa,Pa){var Qa;var Ra=this.localFunctionCache[Oa];if(Ra!=undefined){Qa=this.serialize(Ra.apply(null,this.deserialize(Pa)));}
return Qa;},getUserTypeDescriptor:function(Sa){var Ta=Sa.replace(/^([^:]*)\:\:([^:]*)$/,"$2");var Ua=((typeof window[Ta]=="function")&&(typeof FABridge.userTypes[Ta]!="undefined"));var Va=false;if(Ua){Va=FABridge.userTypes[Ta].enriched;}
var Wa={'simpleType':Ta,'isUserProto':Ua,'protoEnriched':Va};return Wa;},getTypeFromName:function(Xa){var ut=this.getUserTypeDescriptor(Xa);var Ya=this.remoteTypeCache[Xa];if(ut.isUserProto){if(!ut.protoEnriched){for(i in window[ut.simpleType].prototype){Ya[i]=window[ut.simpleType].prototype[i];}
window[ut.simpleType].prototype=Ya;this.remoteTypeCache[Xa]=Ya;FABridge.userTypes[ut.simpleType].enriched=true;}}
return Ya;},createProxy:function(Za,$a){var ut=this.getUserTypeDescriptor($a);var ab=this.getTypeFromName($a);if(ut.isUserProto){var bb=window[ut.simpleType];var cb=new bb(this.name,Za);cb.fb_instance_id=Za;}
else{instanceFactory.prototype=ab;var cb=new instanceFactory(Za);}
this.remoteInstanceCache[Za]=cb;return cb;},getProxy:function(db){return this.remoteInstanceCache[db];},addTypeDataToCache:function(eb){newType=new ASProxy(this,eb.name);var fb=eb.accessors;for(var i=0;i<fb.length;i++){this.addPropertyToType(newType,fb[i]);}
var gb=eb.methods;for(var i=0;i<gb.length;i++){if(FABridge.blockedMethods[gb[i]]==undefined){this.addMethodToType(newType,gb[i]);}}
this.remoteTypeCache[newType.typeName]=newType;return newType;},addPropertyToType:function(ty,hb){var c=hb.charAt(0);var ib;var jb;if(c>="a"&&c<="z"){jb="get"+c.toUpperCase()+hb.substr(1);ib="set"+c.toUpperCase()+hb.substr(1);}
else{jb="get"+hb;ib="set"+hb;}
ty[ib]=function(kb){this.bridge.setPropertyInAS(this.fb_instance_id,hb,kb);}
ty[jb]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,hb));}},addMethodToType:function(ty,lb){ty[lb]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,lb,FABridge.argsToArray(arguments)));}},getFunctionProxy:function(mb){var nb=this;if(this.remoteFunctionCache[mb]==null){this.remoteFunctionCache[mb]=function(){nb.callASFunction(mb,FABridge.argsToArray(arguments));}}
return this.remoteFunctionCache[mb];},getFunctionID:function(ob){if(ob.__bridge_id__==undefined){ob.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[ob.__bridge_id__]=ob;}
return ob.__bridge_id__;},serialize:function(pb){var qb={};var t=typeof(pb);if(t=="number"||t=="string"||t=="boolean"||t==null||t==undefined){qb=pb;}
else if(pb instanceof Array){qb=[];for(var i=0;i<pb.length;i++){qb[i]=this.serialize(pb[i]);}}
else if(t=="function"){qb.type=FABridge.TYPE_JSFUNCTION;qb.value=this.getFunctionID(pb);}
else if(pb instanceof ASProxy){qb.type=FABridge.TYPE_ASINSTANCE;qb.value=pb.fb_instance_id;}
else{qb.type=FABridge.TYPE_ANONYMOUS;qb.value=pb;}
return qb;},deserialize:function(rb){var sb;var t=typeof(rb);if(t=="number"||t=="string"||t=="boolean"||rb==null||rb==undefined){sb=this.handleError(rb);}
else if(rb instanceof Array){sb=[];for(var i=0;i<rb.length;i++){sb[i]=this.deserialize(rb[i]);}}
else if(t=="object"){for(var i=0;i<rb.newTypes.length;i++){this.addTypeDataToCache(rb.newTypes[i]);}
for(var tb in rb.newRefs){this.createProxy(tb,rb.newRefs[tb]);}
if(rb.type==FABridge.TYPE_PRIMITIVE){sb=rb.value;}
else if(rb.type==FABridge.TYPE_ASFUNCTION){sb=this.getFunctionProxy(rb.value);}
else if(rb.type==FABridge.TYPE_ASINSTANCE){sb=this.getProxy(rb.value);}
else if(rb.type==FABridge.TYPE_ANONYMOUS){sb=rb.value;}}
return sb;},addRef:function(ub){this.target.incRef(ub.fb_instance_id);},release:function(vb){this.target.releaseRef(vb.fb_instance_id);},handleError:function(wb){if(typeof(wb)=="string"&&wb.indexOf("__FLASHERROR")==0){var xb=wb.split("||");if(FABridge.refCount>0){FABridge.refCount--;}
throw new Error(xb[1]);return wb;}
else{return wb;}}};ASProxy=function(yb,zb){this.bridge=yb;this.typeName=zb;return this;};ASProxy.prototype={get:function(Ab){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,Ab));},set:function(Bb,Cb){this.bridge.setPropertyInAS(this.fb_instance_id,Bb,Cb);},call:function(Db,Eb){this.bridge.callASMethod(this.fb_instance_id,Db,Eb);},addRef:function(){this.bridge.addRef(this);},release:function(){this.bridge.release(this);}};