/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  January 31st 2010 7:52:41 AM PST                             */
/*      Machine:  10.16.140.104                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/support/FABridge.js h:cuuxz05p                            */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/support/FABridge.js                                       */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/support\/FABridge.js"]); }

function FABridge(_L0,_L1){this.target=_L0;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=FABridge.nextBridgeID++;this.name=_L1;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(_L0){var _L1=[];for(var i=0;i<_L0.length;i++)_L1[i]=_L0[i];return _L1;};function instanceFactory(_L0){this.fb_instance_id=_L0;return this;}function FABridge__invokeJSFunction(_L0){var _L1=_L0[0];var _L2=_L0.concat();_L2.shift();var _L3=FABridge.extractBridgeFromID(_L1);return _L3.invokeLocalFunction(_L1,_L2);}FABridge.addInitializationCallback=function(_L0,_L1){var _L2=FABridge.instances[_L0];if(_L2!=undefined){_L1.call(_L2);return;}var _L3=FABridge.initCallbacks[_L0];if(_L3==null)FABridge.initCallbacks[_L0]=_L3=[];_L3.push(_L1);};function FABridge__bridgeInitialized(_L0){var _L1="bridgeName="+_L0;if(/Explorer/.test(navigator.appName)||/Konqueror|Safari|KHTML/.test(navigator.appVersion)){var _L2=document.getElementsByTagName("object");if(_L2.length==1){FABridge.attachBridge(_L2[0],_L0);}else for(var i=0;i<_L2.length;i++){var _L4=_L2[i];var _L5=_L4.childNodes;var _L6=false;for(var j=0;j<_L5.length;j++){var _L8=_L5[j];if(_L8.nodeType==1&&_L8.tagName.toLowerCase()=="param")if(_L8["name"].toLowerCase()=="flashvars"&&_L8["value"].indexOf(_L1)>=0){FABridge.attachBridge(_L4,_L0);_L6=true;break;}}if(_L6)break;}}else{var _L2=document.getElementsByTagName("embed");if(_L2.length==1){FABridge.attachBridge(_L2[0],_L0);}else for(var i=0;i<_L2.length;i++){var _L4=_L2[i];var _L9=_L4.attributes.getNamedItem("flashVars").nodeValue;if(_L9.indexOf(_L1)>=0)FABridge.attachBridge(_L4,_L0);}}return true;}FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;FABridge.extractBridgeFromID=function(id){var _L1=(id>>16);return FABridge.idMap[_L1];};FABridge.attachBridge=function(_L0,_L1){var _L2=new FABridge(_L0,_L1);FABridge[_L1]=_L2;var _L3=FABridge.initCallbacks[_L1];if(_L3==null)return;for(var i=0;i<_L3.length;i++)_L3[i].call(_L2);delete FABridge.initCallbacks[_L1];};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(_L0){if(typeof(_L0)!="object"){return false;}else{var ret=this.target.releaseNamedASObject(_L0.fb_instance_id);return ret;}},create:function(_L0){return this.deserialize(this.target.create(_L0));},makeID:function(_L0){return (this.bridgeID<<16)+_L0;},getPropertyFromAS:function(_L0,_L1){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(_L0,_L1);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},setPropertyInAS:function(_L0,_L1,_L2){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(_L0,_L1,this.serialize(_L2));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASFunction:function(_L0,_L1){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(_L0,this.serialize(_L1));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASMethod:function(_L0,_L1,_L2){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++;_L2=this.serialize(_L2);retVal=this.target.invokeASMethod(_L0,_L1,_L2);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},invokeLocalFunction:function(_L0,_L1){var _L2;var _L3=this.localFunctionCache[_L0];if(_L3!=undefined)_L2=this.serialize(_L3.apply(null,this.deserialize(_L1)));return _L2;},getUserTypeDescriptor:function(_L0){var _L1=_L0.replace(/^([^:]*)\:\:([^:]*)$/,"$2");var _L2=((typeof window[_L1]=="function")&&(typeof FABridge.userTypes[_L1]!="undefined"));var _L3=false;if(_L2)_L3=FABridge.userTypes[_L1].enriched;var _L4={'simpleType':_L1,'isUserProto':_L2,'protoEnriched':_L3};return _L4;},getTypeFromName:function(_L0){var ut=this.getUserTypeDescriptor(_L0);var _L2=this.remoteTypeCache[_L0];if(ut.isUserProto)if(!ut.protoEnriched){for(i in window[ut.simpleType].prototype)_L2[i]=window[ut.simpleType].prototype[i];window[ut.simpleType].prototype=_L2;this.remoteTypeCache[_L0]=_L2;FABridge.userTypes[ut.simpleType].enriched=true;}return _L2;},createProxy:function(_L0,_L1){var ut=this.getUserTypeDescriptor(_L1);var _L3=this.getTypeFromName(_L1);if(ut.isUserProto){var _L4=window[ut.simpleType];var _L5=new _L4(this.name,_L0);_L5.fb_instance_id=_L0;}else{instanceFactory.prototype=_L3;var _L5=new instanceFactory(_L0);}this.remoteInstanceCache[_L0]=_L5;return _L5;},getProxy:function(_L0){return this.remoteInstanceCache[_L0];},addTypeDataToCache:function(_L0){newType=new ASProxy(this,_L0.name);var _L1=_L0.accessors;for(var i=0;i<_L1.length;i++)this.addPropertyToType(newType,_L1[i]);var _L3=_L0.methods;for(var i=0;i<_L3.length;i++)if(FABridge.blockedMethods[_L3[i]]==undefined)this.addMethodToType(newType,_L3[i]);this.remoteTypeCache[newType.typeName]=newType;return newType;},addPropertyToType:function(ty,_L1){var c=_L1.charAt(0);var _L3;var _L4;if(c>="a"&&c<="z"){_L4="get"+c.toUpperCase()+_L1.substr(1);_L3="set"+c.toUpperCase()+_L1.substr(1);}else{_L4="get"+_L1;_L3="set"+_L1;}ty[_L3]=function(val){this.bridge.setPropertyInAS(this.fb_instance_id,_L1,val);};ty[_L4]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,_L1));};},addMethodToType:function(ty,_L1){ty[_L1]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,_L1,FABridge.argsToArray(arguments)));};},getFunctionProxy:function(_L0){var _L1=this;if(this.remoteFunctionCache[_L0]==null)this.remoteFunctionCache[_L0]=function(){_L1.callASFunction(_L0,FABridge.argsToArray(arguments));};return this.remoteFunctionCache[_L0];},getFunctionID:function(_L0){if(_L0.__bridge_id__==undefined){_L0.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[_L0.__bridge_id__]=_L0;}return _L0.__bridge_id__;},serialize:function(_L0){var _L1={};var t=typeof(_L0);if(t=="number"||t=="string"||t=="boolean"||t==null||t==undefined){_L1=_L0;}else if(_L0 instanceof Array||typeof(_L0.sort)=="function"){_L1=[];for(var i=0;i<_L0.length;i++)_L1[i]=this.serialize(_L0[i]);}else if(t=="function"){_L1.type=FABridge.TYPE_JSFUNCTION;_L1.value=this.getFunctionID(_L0);}else if(_L0 instanceof ASProxy){_L1.type=FABridge.TYPE_ASINSTANCE;_L1.value=_L0.fb_instance_id;}else{_L1.type=FABridge.TYPE_ANONYMOUS;_L1.value=_L0;}return _L1;},deserialize:function(_L0){var _L1;var t=typeof(_L0);if(t=="number"||t=="string"||t=="boolean"||_L0==null||_L0==undefined){_L1=this.handleError(_L0);}else if(_L0 instanceof Array){_L1=[];for(var i=0;i<_L0.length;i++)_L1[i]=this.deserialize(_L0[i]);}else if(t=="object"){for(var i=0;i<_L0.newTypes.length;i++)this.addTypeDataToCache(_L0.newTypes[i]);for(var _L4 in _L0.newRefs)this.createProxy(_L4,_L0.newRefs[_L4]);if(_L0.type==FABridge.TYPE_PRIMITIVE){_L1=_L0.value;}else if(_L0.type==FABridge.TYPE_ASFUNCTION){_L1=this.getFunctionProxy(_L0.value);}else if(_L0.type==FABridge.TYPE_ASINSTANCE){_L1=this.getProxy(_L0.value);}else if(_L0.type==FABridge.TYPE_ANONYMOUS)_L1=_L0.value;}return _L1;},addRef:function(obj){this.target.incRef(obj.fb_instance_id);},release:function(obj){this.target.releaseRef(obj.fb_instance_id);},handleError:function(_L0){if(typeof(_L0)=="string"&&_L0.indexOf("__FLASHERROR")==0){var _L1=_L0.split("||");if(FABridge.refCount>0)FABridge.refCount--;throw new Error(_L1[1]);return _L0;}else return _L0;}};ASProxy=function(_L0,_L1){this.bridge=_L0;this.typeName=_L1;return this;};ASProxy.prototype={get:function(_L0){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,_L0));},set:function(_L0,_L1){this.bridge.setPropertyInAS(this.fb_instance_id,_L0,_L1);},call:function(_L0,_L1){this.bridge.callASMethod(this.fb_instance_id,_L0,_L1);},addRef:function(){this.bridge.addRef(this);},release:function(){this.bridge.release(this);}};

if (window.Bootloader) { Bootloader.done(["js\/support\/FABridge.js"]); }