/*
 * LIGHTSTREAMER - www.lightstreamer.com
 * Lightstreamer HTML Client - lsflashbridge.js
 * Version 5.0 Build 1446.8 $Revision: 31204 $
 * Copyright (c) 2004-2012 Weswit Srl. All Rights Reserved.
 */
 
    if(!window.Lightstreamer){throw("Warning: lscommons.js not included before lsflashbridge.js");}Lightstreamer.vB=" 28344 $"; Lightstreamer.Pg.getLogger("FB").log("flashbridge");   (function(ls){   Lightstreamer.FlashBridge=function(WH){ this.XQ=null; this.WH=WH; this.Si={}; this.sG=false; this.Gj=ls.Pg.getLogger("FB");ls.FlashBridge.bridges[WH]=this;if(ls.cL.Eh){this.YX();}this.El();}; ls.FlashBridge.UZ=function(){for(var Hi in this.bridges){this.bridges[Hi].YX();}};Lightstreamer.FlashBridge.prototype={ Ie:function(){if(this.XQ.length){for(var Hi=0;Hi<this.XQ.length;Hi++){if(this.XQ[Hi].onStatusChange){this.XQ=this.XQ[Hi];return;}}}}, YX:function(){this.Gj.log('YX',this.WH); if(navigator.appName.indexOf("Microsoft")!=-1){this.XQ=eval("window."+this.WH); if(!this.XQ.onStatusChange){ this.Ie();}}else{this.XQ=eval("window.document."+this.WH);}if(!this.XQ){this.Gj.error("Unable to get the Flash movie object reference named: "+this.WH,"FlashBridge");}else{this.El();}}, or:function(ME){if(!this.XQ){this.Gj.log('or',this.WH,1);return;}else if(!ls.FlashBridge.eT[this.WH]){this.Gj.log('or',this.WH,2);return;}else if(!this.XQ.onStatusChange){      this.Gj.log('or',this.WH,4);return;}this.Gj.log('or',this.WH,3); try{this.XQ.onStatusChange(ME);}catch(OS){this.Gj.LWv(OS,this.XQ.onStatusChange,"onStatusChange");}}, GcV:function(){ return this.XQ.onStatusChange&&this.XQ.onReady;}, El:function(aQ){ if(!ls.sa){this.Gj.log('El',this.WH,0);return;}else if(!this.XQ){this.Gj.log('El',this.WH,1);return;}else if(!ls.FlashBridge.eT[this.WH]){this.Gj.log('El',this.WH,2);return;}else if(!this.XQ.onStatusChange){  if(navigator.appName.indexOf("Microsoft")!=-1){this.Ie();}if(!this.GcV()){    this.Gj.error("Unable to call the Flash movie's callbacks: "+this.WH,"FlashBridge"); aQ=aQ?(aQ*2>3000?3000:aQ*2):50;ls.as.ZLP(this.El,aQ,this,[aQ]);this.Gj.log('El',this.WH,4,aQ);return;}} this.Gj.log('El',this.WH,3);if(!this.sG){ try{this.XQ.onReady();}catch(OS){this.Gj.LWv(OS,this.XQ.onReady,"onReady");}}if(ls.Zg.Eb&&ls.sa&&ls.sa.fr){this.or(ls.sa.fr.getStatus());}else{this.or("WAITING");} if(this.onBridgeReady&&!this.sG){try{this.onBridgeReady(this.XQ);}catch(OS){this.Gj.LWv(OS,this.onBridgeReady,"onBridgeReady");}this.sG=true;}}, getFlashObject:function(){if(!this.XQ){this.Gj.error("The object related to the Flash movie named "+this.WH+" is not ready","FlashBridge");return null;}else{return this.XQ;}}, onBridgeReady:function(){return;}, createTable:function(DW,Hn,lX,id){ this.Gj.log("createTable",this.WH,DW,Hn,lX,id);this.Si[id]=new ls.NonVisualTable(DW,Hn,lX);}, subscribeTable:function(id,jZ){this.Gj.log("subscribeTable",this.WH,id,this.Si[id],jZ);  if(!this.XQ){this.Gj.error("The FlashBridge is not yet ready, please delay your Flash calls","subscribeTable");return;}else if(!ls.sa){this.Gj.error("PushPage is not yet binded, please delay your Flash calls","subscribeTable");return;}else if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"subscribeTable");return;}   for(var NE in ls.oL){this.Si[id][NE]=ls.oL[NE](ls.FlashBridge.bridges[this.WH],jZ);}ls.sa.addTable(this.Si[id],jZ);}, unsubscribeTable:function(jZ){this.Gj.log("unsubscribeTable",this.WH,id);  if(!ls.sa){this.Gj.error("PushPage is not yet binded, please delay your Flash calls","unsubscribeTable");return;}ls.sa.removeTable(jZ);}, setItemsRange:function(id,vZ,Ch){this.Gj.log("setItemsRange",this.WH,id,vZ,Ch);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setItemsRange");return;}this.Si[id].setItemsRange(vZ,Ch);}, setSnapshotRequired:function(id,ND){this.Gj.log("setSnapshotRequired",this.WH,id,ND);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setSnapshotRequired");return;}this.Si[id].setSnapshotRequired(ND);}, setRequestedMaxFrequency:function(id,CE){this.Gj.log("setRequestedMaxFrequency",this.WH,id,CE);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setRequestedMaxFrequency");return;}this.Si[id].setRequestedMaxFrequency(CE);}, setRequestedBufferSize:function(id,nD){this.Gj.log("setRequestedBufferSize",this.WH,id,nD);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setRequestedBufferSize");return;}this.Si[id].setRequestedBufferSize(nD);}, setSelector:function(id,selector){this.Gj.log("setSelector",this.WH,id,selector);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setSelector");return;}this.Si[id].setSelector(selector);}, setDataAdapter:function(id,jB){this.Gj.log("setDataAdapter",this.WH,id,jB);if(!this.Si[id]){this.Gj.error("This table does not exist: "+id,"setDataAdapter");return;}this.Si[id].setDataAdapter(jB);}};   ls.FlashBridge.eT={}; ls.FlashBridge.bridges={}; ls.FlashBridge.flashIsReady=function(WH){ this.eT[WH]=true;ls.Pg.getLogger("FB").log("flashIsReady",WH);if(ls.FlashBridge.bridges[WH]!=null){ls.FlashBridge.bridges[WH].El();}};})(Lightstreamer);     (function(ls){ls.oL={onItemUpdate:function(FI,jZ){var dW=ls.Pg.getLogger("FB");return function(wZ,Pa,Yk){ var sj={};sj.length=Pa.getNumFields();for(var Hi=1;Hi<=sj.length;Hi++){sj[Hi+"_old"]=Pa.getOldValue(Hi);if(Pa.isValueChanged(Hi)){sj[Hi]=Pa.getNewValue(Hi);}else{sj[Hi]={};sj[Hi].length=-1;}var Jp=Pa.da.Aw.jMk(Hi); if(Jp!=null){sj[Jp+"_pos"]=Hi;}}try{FI.XQ.onItemUpdate(jZ,wZ,sj,Yk);}catch(OS){dW.LWv(OS,FI.XQ.onItemUpdate,"onItemUpdate");}};},onLostUpdates:function(FI,jZ){var dW=ls.Pg.getLogger("FB");return function(wZ,Zn,Yk){try{FI.XQ.onLostUpdates(jZ,wZ,Zn,Yk);}catch(OS){dW.LWv(OS,FI.XQ.onLostUpdates,"onLostUpdates");}};},onEndOfSnapshot:function(FI,jZ){var dW=ls.Pg.getLogger("FB");return function(wZ,Yk){try{FI.XQ.onEndOfSnapshot(jZ,wZ,Yk);}catch(OS){dW.LWv(OS,FI.XQ.onEndOfSnapshot,"onEndOfSnapshot");}};},onStart:function(FI,jZ){var dW=ls.Pg.getLogger("FB");return function(){try{FI.XQ.onStart(jZ);}catch(OS){dW.LWv(OS,FI.XQ.onStart,"onStart");}};}};})(Lightstreamer);     if(!Lightstreamer.avoidLSGlobals){ window.FlashBridge=Lightstreamer.FlashBridge;}  
