/*
 * LIGHTSTREAMER - www.lightstreamer.com
 * Web Client - lsflashbridge.js - Version 1 $Revision: 1.7 $
 * Copyright (c) 2004-2010 Weswit Srl. All Rights Reserved.
 */
   if(!window.Lightstreamer){throw("Warning: lscommons.js not included before lsflashbridge.js");}Lightstreamer.Cnu="1.24278  28456 $"; Lightstreamer.xaI.getLogger("FB").log("flashbridge");  Lightstreamer.FlashBridge=function(Ljn){ this.LVi=null; this.Ljn=Ljn; this.xVF={}; this.Obf=false; this.HBr=Lightstreamer.xaI.getLogger("FB");Lightstreamer.FlashBridge.bridges[Ljn]=this;if(Lightstreamer.mwQ.fcQ){this.xJn();}this.NPN();}; Lightstreamer.FlashBridge.xTl=function(){for(var BeU in this.bridges){this.bridges[BeU].xJn();}};Lightstreamer.FlashBridge.prototype={ IUw:function(){if(this.LVi.length){for(var BeU=0;BeU<this.LVi.length;BeU++){if(this.LVi[BeU].onStatusChange){this.LVi=this.LVi[BeU];return;}}}}, xJn:function(){this.HBr.log('xJn',this.Ljn); if(navigator.appName.indexOf("Microsoft")!=-1){this.LVi=eval("window."+this.Ljn); if(!this.LVi.onStatusChange){ this.IUw();}}else{this.LVi=eval("window.document."+this.Ljn);}if(!this.LVi){this.HBr.UTi("Unable to get the Flash movie object reference named: "+this.Ljn,"FlashBridge");}else{this.NPN();}}, tKs:function(eal){if(!this.LVi){this.HBr.log('tKs',this.Ljn,1);return;}else if(!Lightstreamer.FlashBridge.fBo[this.Ljn]){this.HBr.log('tKs',this.Ljn,2);return;}else if(!this.LVi.onStatusChange){      this.HBr.log('tKs',this.Ljn,4);return;}this.HBr.log('tKs',this.Ljn,3); try{this.LVi.onStatusChange(eal);}catch(mmO){this.HBr.Cen(mmO,this.LVi.onStatusChange,"onStatusChange");}}, jml:function(){ return this.LVi.onStatusChange;}, NPN:function(vlE){ if(!Lightstreamer.PIF){this.HBr.log('NPN',this.Ljn,0);return;}else if(!this.LVi){this.HBr.log('NPN',this.Ljn,1);return;}else if(!Lightstreamer.FlashBridge.fBo[this.Ljn]){this.HBr.log('NPN',this.Ljn,2);return;}else if(!this.LVi.onStatusChange){  if(navigator.appName.indexOf("Microsoft")!=-1){this.IUw();}if(!this.jml()){    this.HBr.UTi("Unable to call the Flash movie's callbacks: "+this.Ljn,"FlashBridge"); vlE=vlE?(vlE*2>3000?3000:vlE*2):50;ls.executor.addTimedTask(this.NPN,vlE,this,[vlE]);this.HBr.log('NPN',this.Ljn,4,vlE);return;}} this.HBr.log('NPN',this.Ljn,3);if(!this.Obf){ try{this.LVi.onReady();}catch(mmO){this.HBr.Cen(mmO,this.LVi.onReady,"onReady");}}if(Lightstreamer.ptw.ldC&&Lightstreamer.PIF&&Lightstreamer.PIF.xAB){this.tKs(Lightstreamer.PIF.xAB.getStatus());}else{this.tKs("WAITING");} if(this.onBridgeReady&&!this.Obf){try{this.onBridgeReady(this.LVi);}catch(mmO){this.HBr.Cen(mmO,this.onBridgeReady,"onBridgeReady");}this.Obf=true;}}, getFlashObject:function(){if(!this.LVi){this.HBr.UTi("The object related to the Flash movie named "+this.Ljn+" is not ready","FlashBridge");return null;}else{return this.LVi;}}, onBridgeReady:function(){return;}, createTable:function(fWE,GPa,MJK,id){ this.HBr.log("createTable",this.Ljn,fWE,GPa,MJK,id);this.xVF[id]=new Lightstreamer.NonVisualTable(fWE,GPa,MJK);}, subscribeTable:function(id,POd){this.HBr.log("subscribeTable",this.Ljn,id,this.xVF[id],POd);  if(!this.LVi){this.HBr.UTi("The FlashBridge is not yet ready, please delay your Flash calls","subscribeTable");return;}else if(!Lightstreamer.PIF){this.HBr.UTi("PushPage is not yet binded, please delay your Flash calls","subscribeTable");return;}else if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"subscribeTable");return;}   for(var CaF in Lightstreamer.Xmn){this.xVF[id][CaF]=Lightstreamer.Xmn[CaF](Lightstreamer.FlashBridge.bridges[this.Ljn],POd);}Lightstreamer.PIF.addTable(this.xVF[id],POd);}, unsubscribeTable:function(POd){this.HBr.log("unsubscribeTable",this.Ljn,id);  if(!Lightstreamer.PIF){this.HBr.UTi("PushPage is not yet binded, please delay your Flash calls","unsubscribeTable");return;}Lightstreamer.PIF.removeTable(POd);}, setItemsRange:function(id,KTr,LOI){this.HBr.log("setItemsRange",this.Ljn,id,KTr,LOI);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setItemsRange");return;}this.xVF[id].setItemsRange(KTr,LOI);}, setSnapshotRequired:function(id,ATK){this.HBr.log("setSnapshotRequired",this.Ljn,id,ATK);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setSnapshotRequired");return;}this.xVF[id].setSnapshotRequired(ATK);}, setRequestedMaxFrequency:function(id,UEl){this.HBr.log("setRequestedMaxFrequency",this.Ljn,id,UEl);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setRequestedMaxFrequency");return;}this.xVF[id].setRequestedMaxFrequency(UEl);}, setRequestedBufferSize:function(id,THX){this.HBr.log("setRequestedBufferSize",this.Ljn,id,THX);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setRequestedBufferSize");return;}this.xVF[id].setRequestedBufferSize(THX);}, setSelector:function(id,selector){this.HBr.log("setSelector",this.Ljn,id,selector);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setSelector");return;}this.xVF[id].setSelector(selector);}, setDataAdapter:function(id,gPF){this.HBr.log("setDataAdapter",this.Ljn,id,gPF);if(!this.xVF[id]){this.HBr.UTi("This table does not exist: "+id,"setDataAdapter");return;}this.xVF[id].setDataAdapter(gPF);}};with(Lightstreamer){ FlashBridge.fBo={}; FlashBridge.bridges={}; FlashBridge.flashIsReady=function(Ljn){ this.fBo[Ljn]=true;Lightstreamer.xaI.getLogger("FB").log("flashIsReady",Ljn);if(FlashBridge.bridges[Ljn]!=null){FlashBridge.bridges[Ljn].NPN();}};}   Lightstreamer.Xmn={onItemUpdate:function(Wmf,POd){var cVi=Lightstreamer.xaI.getLogger("FB");return function(ILA,KLK,NZC){ var tRw={};tRw.length=KLK.getNumFields();for(var BeU=1;BeU<=tRw.length;BeU++){tRw[BeU+"_old"]=KLK.getOldValue(BeU);if(KLK.isValueChanged(BeU)){tRw[BeU]=KLK.getNewValue(BeU);}else{tRw[BeU]={};tRw[BeU].length=-1;}var sEk=KLK.ARr.fIP.aES(BeU); if(sEk!=null){tRw[sEk+"_pos"]=BeU;}}try{Wmf.LVi.onItemUpdate(POd,ILA,tRw,NZC);}catch(mmO){cVi.Cen(mmO,Wmf.LVi.onItemUpdate,"onItemUpdate");}};},onLostUpdates:function(Wmf,POd){var cVi=Lightstreamer.xaI.getLogger("FB");return function(ILA,Ovd,NZC){try{Wmf.LVi.onLostUpdates(POd,ILA,Ovd,NZC);}catch(mmO){cVi.Cen(mmO,Wmf.LVi.onLostUpdates,"onLostUpdates");}};},onEndOfSnapshot:function(Wmf,POd){var cVi=Lightstreamer.xaI.getLogger("FB");return function(ILA,NZC){try{Wmf.LVi.onEndOfSnapshot(POd,ILA,NZC);}catch(mmO){cVi.Cen(mmO,Wmf.LVi.onEndOfSnapshot,"onEndOfSnapshot");}};},onStart:function(Wmf,POd){var cVi=Lightstreamer.xaI.getLogger("FB");return function(){try{Wmf.LVi.onStart(POd);}catch(mmO){cVi.Cen(mmO,Wmf.LVi.onStart,"onStart");}};}};     if(!Lightstreamer.avoidLSGlobals){ window.FlashBridge=Lightstreamer.FlashBridge;}  
