home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / roam-and-protect.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2005-09-29  |  50.8 KB  |  1,854 lines

  1. function getNetDebugVersion()
  2. {
  3.    return 1;
  4. }
  5. function NetDebugConfig()
  6. {
  7. }
  8. function attachNetDebugConfigFunctions(ndc)
  9. {
  10.    var _loc1_ = ndc;
  11.    _loc1_.setDebug = function(setval)
  12.    {
  13.       this.m_debug = setval;
  14.    };
  15.    _loc1_.getDebug = function()
  16.    {
  17.       return this.m_debug;
  18.    };
  19.    for(var _loc2_ in _loc1_)
  20.    {
  21.       if(typeof _loc1_[_loc2_] == "object")
  22.       {
  23.          attachNetDebugConfigFunctions(_loc1_[_loc2_]);
  24.       }
  25.    }
  26. }
  27. function getDefaultNetDebugConfig(iscontroller)
  28. {
  29.    var _loc1_ = _global;
  30.    if(_loc1_.netDebugConfigSO == undefined)
  31.    {
  32.       var _loc2_ = "TestMovie_Config_Info";
  33.       if(iscontroller)
  34.       {
  35.          _loc2_ = "Controller_Config_Info";
  36.       }
  37.       _loc1_.netDebugConfigSO = SharedObject.getLocal(_loc2_);
  38.    }
  39.    if(_loc1_.netDebugConfigSO.data.config == undefined)
  40.    {
  41.       _loc1_.netDebugConfigSO.data.config = getRealDefaultNetDebugConfig();
  42.    }
  43.    _loc1_.netDebugConfigSO.flush();
  44.    return _loc1_.netDebugConfigSO.data.config;
  45. }
  46. function getRealDefaultNetDebugConfig()
  47. {
  48.    var _loc1_ = new NetDebugConfig();
  49.    _loc1_.m_debug = true;
  50.    _loc1_.client = new NetDebugConfig();
  51.    _loc1_.client.m_debug = true;
  52.    _loc1_.client.trace = true;
  53.    _loc1_.client.recordset = true;
  54.    _loc1_.client.http = true;
  55.    _loc1_.client.rtmp = true;
  56.    _loc1_.realtime_server = new NetDebugConfig();
  57.    _loc1_.realtime_server.m_debug = true;
  58.    _loc1_.realtime_server.trace = true;
  59.    _loc1_.app_server = new NetDebugConfig();
  60.    _loc1_.app_server.m_debug = true;
  61.    _loc1_.app_server.trace = true;
  62.    _loc1_.app_server.error = true;
  63.    _loc1_.app_server.recordset = true;
  64.    _loc1_.app_server.httpheaders = false;
  65.    _loc1_.app_server.amf = false;
  66.    _loc1_.app_server.amfheaders = false;
  67.    _loc1_.app_server.coldfusion = true;
  68.    return _loc1_;
  69. }
  70. function NetDebugEvent()
  71. {
  72. }
  73. function NetDebugErrorEvent(dataobj)
  74. {
  75.    var _loc1_ = this;
  76.    _loc1_.init();
  77.    _loc1_.EventType = "NetDebugError";
  78.    _loc1_.Error = dataobj;
  79. }
  80. function NetDebugTraceEvent(traceobj)
  81. {
  82.    var _loc1_ = this;
  83.    _loc1_.init();
  84.    _loc1_.EventType = "Trace";
  85.    _loc1_.Trace = traceobj;
  86. }
  87. function NetDebugTraceNetServicesEvent(w, s, n, m)
  88. {
  89.    var _loc1_ = this;
  90.    _loc1_.init();
  91.    _loc1_.EventType = "NetServicesTrace";
  92.    _loc1_.Trace = m;
  93.    _loc1_.Who = w;
  94.    _loc1_.Severity = s;
  95.    _loc1_.Number = n;
  96. }
  97. function NetDebugNCEvent()
  98. {
  99. }
  100. function NetDebugResultEvent(resultobj)
  101. {
  102.    var _loc1_ = this;
  103.    _loc1_.init();
  104.    _loc1_.EventType = "Result";
  105.    _loc1_.Result = resultobj;
  106. }
  107. function NetDebugStatusEvent(statusobj)
  108. {
  109.    var _loc1_ = this;
  110.    _loc1_.init();
  111.    _loc1_.EventType = "Status";
  112.    _loc1_.Status = statusobj;
  113. }
  114. function NetDebugConnectEvent(args)
  115. {
  116.    var _loc1_ = this;
  117.    var _loc2_ = args;
  118.    _loc1_.init();
  119.    _loc1_.EventType = "Connect";
  120.    _loc1_.ConnectString = _loc2_[0];
  121.    if(_loc2_[1] != null)
  122.    {
  123.       _loc1_.UserName = _loc2_[1];
  124.    }
  125.    if(_loc2_[2] != null)
  126.    {
  127.       _loc1_.Password = _loc2_[2];
  128.    }
  129. }
  130. function NetDebugCallEvent(args)
  131. {
  132.    var _loc2_ = this;
  133.    var _loc3_ = args;
  134.    _loc2_.init();
  135.    _loc2_.EventType = "Call";
  136.    _loc2_.MethodName = _loc3_[0];
  137.    _loc2_.Parameters = new Array();
  138.    var alen = _loc3_.length;
  139.    var _loc1_ = 2;
  140.    while(_loc1_ < alen)
  141.    {
  142.       _loc2_.Parameters[_loc1_ - 2] = _loc3_[_loc1_];
  143.       _loc1_ = _loc1_ + 1;
  144.    }
  145. }
  146. function NetDebugCloseEvent()
  147. {
  148.    this.init();
  149.    this.EventType = "Close";
  150. }
  151. function NetDebugAddHeaderEvent(args)
  152. {
  153.    var _loc1_ = this;
  154.    var _loc2_ = args;
  155.    _loc1_.init();
  156.    _loc1_.EventType = "AddHeader";
  157.    _loc1_.HeaderName = _loc2_[0];
  158.    _loc1_.MustUnderstand = _loc2_[1];
  159.    if(_loc2_[2] != null)
  160.    {
  161.       _loc1_.HeaderObject = _loc2_[2];
  162.    }
  163. }
  164. function NetDebugRtmpLogEvent(infoobj)
  165. {
  166.    var _loc1_ = this;
  167.    _loc1_.initDate();
  168.    _loc1_.EventType = "Trace";
  169.    _loc1_.Source = "Flash Communication Server";
  170.    _loc1_.Info = infoobj;
  171.    _loc1_.Trace = infoobj.description;
  172. }
  173. function NetDebugDuplicateNCDErrorEvent()
  174. {
  175.    var _loc1_ = this;
  176.    _loc1_.initDate();
  177.    _loc1_.EventType = "Error";
  178.    _loc1_.Source = "NCD";
  179.    _loc1_.Message = "NCD_ALREADY_RUNNING";
  180. }
  181. function NetDebugFailedSendErrorEvent(ev)
  182. {
  183.    var _loc1_ = this;
  184.    _loc1_.initDate();
  185.    _loc1_.EventType = "Error";
  186.    _loc1_.Source = "NCD";
  187.    _loc1_.OriginalEvent = ev;
  188.    _loc1_.Message = "NCD_FAILED_TO_SEND_EVENT";
  189. }
  190. function NetDebugInfoErrorEvent(infoobj, mes)
  191. {
  192.    var _loc1_ = this;
  193.    _loc1_.initDate();
  194.    _loc1_.EventType = "Error";
  195.    _loc1_.Source = "NCD";
  196.    _loc1_.Info = infoobj;
  197.    if(mes != null)
  198.    {
  199.       _loc1_.Message = mes;
  200.    }
  201. }
  202. function NetDebugReceiveCallEvent(mName, args)
  203. {
  204.    var _loc1_ = this;
  205.    _loc1_.init();
  206.    _loc1_.EventType = "ReceivedCall";
  207.    _loc1_.MethodName = mName;
  208.    _loc1_.Parameters = args;
  209. }
  210. function netDebugProxyConnect()
  211. {
  212.    var _loc1_ = this;
  213.    var _loc2_ = arguments;
  214.    _loc1_.attachDebug();
  215.    var _loc3_ = _loc2_[0].substr(0,4);
  216.    if(_loc3_ == "http" || _loc3_.substr(0,4) == "rtmp")
  217.    {
  218.       if(_loc2_[0].charAt(4) == ":")
  219.       {
  220.          _loc1_.m_Protocol = _loc3_;
  221.       }
  222.       else
  223.       {
  224.          _loc1_.m_Protocol = _loc2_[0].substr(0,5);
  225.       }
  226.    }
  227.    else
  228.    {
  229.       _loc1_.m_Protocol = "http";
  230.    }
  231.    _loc1_.sendClientEvent(new NetDebugConnectEvent(_loc2_));
  232.    if(_loc1_.isRealTime())
  233.    {
  234.       _loc1_.m_ConnectString = _loc2_[0];
  235.       getNetDebug().sendCommand(new StartRTMPTraceCommand(_loc2_[0]));
  236.       var ret = _loc1_.realconnect.apply(_loc1_,_loc2_);
  237.       _loc1_.realcall("@getClientID",new RTMPClientIDResponse(_loc2_[0],_loc1_));
  238.       return ret;
  239.    }
  240.    return _loc1_.realconnect.apply(_loc1_,_loc2_);
  241. }
  242. function netDebugProxyCall()
  243. {
  244.    var _loc1_ = this;
  245.    var _loc2_ = arguments;
  246.    _loc1_.attachDebug();
  247.    _loc1_.sendClientEvent(new NetDebugCallEvent(_loc2_));
  248.    _loc1_.addNetDebugHeader();
  249.    if(_loc1_.m_Config.app_server)
  250.    {
  251.       _loc2_[1] = new NetDebugResponseProxy(_loc1_,_loc2_[1]);
  252.       return _loc1_.realcall.apply(_loc1_,_loc2_);
  253.    }
  254.    return _loc1_.realcall.apply(_loc1_,_loc2_);
  255. }
  256. function netDebugProxyClose()
  257. {
  258.    var _loc1_ = this;
  259.    _loc1_.attachDebug();
  260.    _loc1_.sendClientEvent(new NetDebugCloseEvent());
  261.    if(_loc1_.isRealTime())
  262.    {
  263.       getNetDebug().sendCommand(new StopRTMPTraceCommand(_loc1_.m_ConnectString,_loc1_.m_ClientId));
  264.    }
  265.    var _loc2_ = _loc1_.realclose();
  266.    getNetDebug().removeNetConnection(_loc1_);
  267.    return _loc2_;
  268. }
  269. function netDebugProxyAddHeader()
  270. {
  271.    var _loc1_ = this;
  272.    _loc1_.attachDebug();
  273.    _loc1_.sendClientEvent(new NetDebugAddHeaderEvent(arguments));
  274.    return _loc1_.realaddHeader.apply(_loc1_,arguments);
  275. }
  276. function RTMPClientIDResponse(cs, nc)
  277. {
  278.    this.m_ConnectString = cs;
  279.    this.m_NC = nc;
  280. }
  281. function NetDebugResponseProxy(source, original)
  282. {
  283.    this.m_SourceNC = source;
  284.    this.m_OriginalNR = original;
  285. }
  286. function GlobalLocalConnection(iscontroller, receiver, domainname)
  287. {
  288.    var _loc2_ = this;
  289.    var _loc3_ = _global;
  290.    _loc2_.maxConnections = 10;
  291.    var sToMovie = "_NetDebugLocalToDebugMovie";
  292.    var sToController = "_NetDebugLocalToController";
  293.    var connectname = null;
  294.    if(iscontroller)
  295.    {
  296.       connectname = sToController;
  297.       _loc2_.sendnames = new Array();
  298.       _loc2_.sendnames.push(sToMovie);
  299.       var _loc1_ = 0;
  300.       while(_loc1_ < _loc2_.maxConnections)
  301.       {
  302.          _loc2_.sendnames.push(sToMovie + _loc1_);
  303.          _loc1_ = _loc1_ + 1;
  304.       }
  305.       _loc2_.maxConnections = 0;
  306.    }
  307.    else
  308.    {
  309.       connectname = sToMovie;
  310.       _loc2_.sendnames = new Array();
  311.       _loc2_.sendnames.push(sToController);
  312.    }
  313.    _loc2_.setDomainName(domainname);
  314.    if(_loc3_.g_NetDebugLocalConnection == undefined)
  315.    {
  316.       _loc3_.g_NetDebugLocalConnection = new LocalConnection();
  317.       _loc3_.g_NetDebugLocalConnection.allowDomain = function()
  318.       {
  319.          return true;
  320.       };
  321.    }
  322.    if(receiver != null)
  323.    {
  324.       _loc3_.g_NetDebugLocalConnection.m_Receiver = receiver;
  325.       _loc3_.g_NetDebugLocalConnection.onData = function(dataobj)
  326.       {
  327.          _global.g_NetDebugLocalConnection.m_Receiver.onReceive(dataobj);
  328.       };
  329.       _loc3_.g_NetDebugLocalConnection.onCommand = function(commandobj)
  330.       {
  331.          _global.g_NetDebugLocalConnection.m_Receiver.onReceiveCommand(commandobj);
  332.       };
  333.       if(!_loc3_.g_NetDebugLocalConnection.connect(connectname))
  334.       {
  335.          var connected = false;
  336.          _loc1_ = 0;
  337.          while(_loc1_ < _loc2_.maxConnections)
  338.          {
  339.             if(_loc3_.g_NetDebugLocalConnection.connect(connectname + _loc1_))
  340.             {
  341.                connected = true;
  342.                break;
  343.             }
  344.             _loc1_ = _loc1_ + 1;
  345.          }
  346.          if(!connected)
  347.          {
  348.             if(iscontroller)
  349.             {
  350.                receiver.onReceiveError(new NetDebugDuplicateNCDErrorEvent());
  351.             }
  352.          }
  353.       }
  354.    }
  355. }
  356. function LocalCommand()
  357. {
  358. }
  359. function UpdateNetDebugConfigCommand(dataobj)
  360. {
  361.    this.init("updateConfig",dataobj);
  362. }
  363. function GetConfigCommand()
  364. {
  365.    this.init("getConfig",null);
  366. }
  367. function StartRTMPTraceCommand(cs)
  368. {
  369.    var _loc1_ = new Object();
  370.    _loc1_.connectstring = cs;
  371.    _loc1_.url = _root._url;
  372.    this.init("startRealTimeTrace",_loc1_);
  373. }
  374. function AddRTMPClientCommand(cs, cid)
  375. {
  376.    var _loc1_ = new Object();
  377.    _loc1_.connectstring = cs;
  378.    _loc1_.url = _root._url;
  379.    _loc1_.clientid = cid;
  380.    this.init("addRealTimeClient",_loc1_);
  381. }
  382. function StopRTMPTraceCommand(cs, cid)
  383. {
  384.    var _loc1_ = new Object();
  385.    _loc1_.connectstring = cs;
  386.    _loc1_.url = _root._url;
  387.    _loc1_.clientid = cid;
  388.    this.init("stopRealTimeTrace",_loc1_);
  389. }
  390. function NetDebug()
  391. {
  392.    var _loc1_ = this;
  393.    _loc1_.m_ncs = new Array();
  394.    _loc1_.m_Config = getDefaultNetDebugConfig();
  395.    _loc1_.m_glc = new GlobalLocalConnection(false,_loc1_);
  396.    _loc1_.m_glc.sendCommand(new GetConfigCommand());
  397.    _loc1_.m_NextNewId = 0;
  398. }
  399. function getNetDebug()
  400. {
  401.    return _global.netDebugInstance;
  402. }
  403. function inserths_Result(result)
  404. {
  405.    _root.inserthsresult = result;
  406. }
  407. _global.RsDataProviderClass = function()
  408. {
  409.    this.init();
  410. };
  411. RsDataProviderClass.prototype.init = function()
  412. {
  413.    var _loc1_ = this;
  414.    _loc1_.items = new Array();
  415.    _loc1_.uniqueID = 0;
  416.    _loc1_.views = new Array();
  417.    mx.events.EventDispatcher.initialize(_loc1_);
  418. };
  419. RsDataProviderClass.prototype.addView = function(viewRef)
  420. {
  421.    this.views.push(viewRef);
  422.    var _loc1_ = {eventName:"updateAll"};
  423.    viewRef.modelChanged(_loc1_);
  424. };
  425. RsDataProviderClass.prototype.addItemAt = function(index, value)
  426. {
  427.    var _loc1_ = index;
  428.    var _loc2_ = this;
  429.    if(_loc2_.checkLocal())
  430.    {
  431.       if(_loc1_ >= 0)
  432.       {
  433.          if(_loc1_ < _loc2_.length)
  434.          {
  435.             _loc2_.items.splice(_loc1_,0,"tmp");
  436.          }
  437.          _loc2_.items[_loc1_] = new Object();
  438.          if(typeof value == "object")
  439.          {
  440.             _loc2_.items[_loc1_] = value;
  441.          }
  442.          _loc2_.items[_loc1_].__ID__ = _loc2_.uniqueID++;
  443.          var _loc3_ = {eventName:"addItems",firstItem:_loc1_,lastItem:_loc1_};
  444.          _loc2_.updateViews(_loc3_);
  445.       }
  446.    }
  447. };
  448. RsDataProviderClass.prototype.addItem = function(value)
  449. {
  450.    var _loc1_ = this;
  451.    if(_loc1_.checkLocal())
  452.    {
  453.       _loc1_.addItemAt(_loc1_.length,value);
  454.    }
  455. };
  456. RsDataProviderClass.prototype.removeItemAt = function(index)
  457. {
  458.    var _loc1_ = index;
  459.    var _loc2_ = this;
  460.    if(_loc2_.checkLocal())
  461.    {
  462.       if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
  463.       {
  464.          var tmpItm = _loc2_.items[_loc1_];
  465.          _loc2_.items.splice(_loc1_,1);
  466.          var _loc3_ = {eventName:"deleteItems",firstItem:_loc1_,lastItem:_loc1_};
  467.          _loc2_.updateViews(_loc3_);
  468.          return tmpItm;
  469.       }
  470.    }
  471. };
  472. RsDataProviderClass.prototype.removeAll = function()
  473. {
  474.    var _loc1_ = this;
  475.    if(_loc1_.checkLocal())
  476.    {
  477.       _loc1_.items = new Array();
  478.       _loc1_.updateViews({eventName:"removeItems",firstItem:0,lastItem:_loc1_.length - 1});
  479.    }
  480. };
  481. RsDataProviderClass.prototype.replaceItemAt = function(index, itemObj)
  482. {
  483.    var _loc1_ = index;
  484.    var _loc2_ = this;
  485.    if(_loc2_.checkLocal())
  486.    {
  487.       if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
  488.       {
  489.          var _loc3_ = _loc2_.getItemID(_loc1_);
  490.          _loc2_.items[_loc1_] = itemObj;
  491.          _loc2_.items[_loc1_].__ID__ = _loc3_;
  492.          _loc2_.updateViews({eventName:"updateItems",firstItem:_loc1_,lastItem:_loc1_});
  493.       }
  494.    }
  495. };
  496. RsDataProviderClass.prototype.getLength = function()
  497. {
  498.    return this.items.length;
  499. };
  500. RsDataProviderClass.prototype.addProperty("length",RsDataProviderClass.prototype.getLength,null);
  501. RsDataProviderClass.prototype.getItemAt = function(index)
  502. {
  503.    return this.items[index];
  504. };
  505. RsDataProviderClass.prototype.getItemID = function(index)
  506. {
  507.    return this.items[index].__ID__;
  508. };
  509. RsDataProviderClass.prototype.sortItems = function(compareFunc, order)
  510. {
  511.    var _loc1_ = this;
  512.    if(_loc1_.checkLocal())
  513.    {
  514.       _loc1_.items.sort(compareFunc);
  515.       if(order == "DESC")
  516.       {
  517.          _loc1_.items.reverse();
  518.       }
  519.       _loc1_.updateViews({eventName:"sort"});
  520.    }
  521. };
  522. RsDataProviderClass.prototype.sortItemsBy = function(fieldName, order)
  523. {
  524.    var _loc1_ = this;
  525.    if(_loc1_.checkLocal())
  526.    {
  527.       _loc1_.items.sortOn(fieldName);
  528.       if(order == "DESC")
  529.       {
  530.          _loc1_.items.reverse();
  531.       }
  532.       _loc1_.updateViews({eventName:"sort",fieldName:fieldName,order:order});
  533.    }
  534. };
  535. RsDataProviderClass.prototype.updateViews = function(eventObj)
  536. {
  537.    var _loc2_ = eventObj;
  538.    _loc2_.type = "modelChanged";
  539.    this.dispatchEvent(_loc2_);
  540.    var _loc3_ = this.views.length;
  541.    if(_loc3_ > 0)
  542.    {
  543.       switch(_loc2_.eventName)
  544.       {
  545.          case "addItems":
  546.             _loc2_.event = "addRows";
  547.             break;
  548.          case "updateItems":
  549.             _loc2_.event = "updateRows";
  550.             break;
  551.          case "removeItems":
  552.             _loc2_.event = "deleteRows";
  553.       }
  554.       _loc2_.firstRow = _loc2_.firstItem;
  555.       _loc2_.lastRow = _loc2_.lastItem;
  556.       var _loc1_ = 0;
  557.       while(_loc1_ < _loc3_)
  558.       {
  559.          this.views[_loc1_].modelChanged(_loc2_);
  560.          _loc1_ = _loc1_ + 1;
  561.       }
  562.    }
  563. };
  564. _global.RecordSet = function(columnNames)
  565. {
  566.    var _loc1_ = this;
  567.    if(_loc1_.mTitles != null)
  568.    {
  569.       _loc1_.views = new Array();
  570.    }
  571.    else
  572.    {
  573.       _loc1_.init();
  574.       if(_loc1_.serverinfo == null)
  575.       {
  576.          if(_loc1_.serverInfo != null)
  577.          {
  578.             _loc1_.serverinfo = _loc1_.serverInfo;
  579.          }
  580.       }
  581.       if(_loc1_.serverinfo == null)
  582.       {
  583.          _loc1_.mTitles = columnNames;
  584.       }
  585.       else if(_loc1_.serverinfo.version != 1)
  586.       {
  587.          NetServices.trace("RecordSet","warning",100,"Received incompatible RecordSet version from server");
  588.       }
  589.       else
  590.       {
  591.          _loc1_.mTitles = _loc1_.serverinfo.columnNames;
  592.          _loc1_.mRecordsAvailable = 0;
  593.          _loc1_.setData(_loc1_.serverinfo.cursor != null ? _loc1_.serverinfo.cursor - 1 : 0,_loc1_.serverinfo.initialData);
  594.          if(_loc1_.serverinfo.initialData.length != _loc1_.serverinfo.totalCount)
  595.          {
  596.             _loc1_.mRecordSetID = _loc1_.serverinfo.id;
  597.             if(_loc1_.mRecordSetID != null)
  598.             {
  599.                _loc1_.serviceName = _loc1_.serverinfo.serviceName != null ? _loc1_.serverinfo.serviceName : "RecordSet";
  600.                _loc1_.mTotalCount = _loc1_.serverinfo.totalCount;
  601.                _loc1_.mDeliveryMode = "ondemand";
  602.                _loc1_.mAllNotified = false;
  603.                _loc1_.mOutstandingRecordCount = 0;
  604.             }
  605.             else
  606.             {
  607.                NetServices.trace("RecordSet","warning",102,"Missing some records, but there\'s no RecordSet id");
  608.             }
  609.          }
  610.          _loc1_.serverinfo = null;
  611.       }
  612.    }
  613. };
  614. RecordSet.prototype = new RsDataProviderClass();
  615. Object.registerClass("RecordSet",RecordSet);
  616. RecordSet.prototype._setParentService = function(service)
  617. {
  618.    this.gateway_conn = service.nc;
  619. };
  620. RecordSet.prototype.getRecordSetService = function()
  621. {
  622.    var _loc1_ = this;
  623.    if(_loc1_.mRecordSetService == null)
  624.    {
  625.       if(_loc1_.gateway_conn == null)
  626.       {
  627.          _loc1_.gateway_conn = NetServices.createGatewayConnection();
  628.       }
  629.       else if(_global.netDebugInstance != undefined)
  630.       {
  631.          _loc1_.gateway_conn = _loc1_.gateway_conn.clone();
  632.       }
  633.       if(_global.netDebugInstance != undefined)
  634.       {
  635.          _loc1_.gateway_conn.setupRecordset();
  636.          _loc1_.gateway_conn.setDebugId("RecordSet " + _loc1_.mRecordSetID);
  637.       }
  638.       _loc1_.mRecordSetService = _loc1_.gateway_conn.getService(_loc1_.serviceName,_loc1_);
  639.       if(_loc1_.mRecordSetService == null)
  640.       {
  641.          NetServices.trace("RecordSet","warning",101,"Failed to create RecordSet service");
  642.          _loc1_.mRecordSetService = 0;
  643.       }
  644.    }
  645.    return _loc1_.mRecordSetService;
  646. };
  647. RecordSet.prototype.getColumnNames = function()
  648. {
  649.    return this.mTitles;
  650. };
  651. RecordSet.prototype.getLength = function()
  652. {
  653.    var _loc1_ = this;
  654.    if(_loc1_.mRecordSetID != null)
  655.    {
  656.       return _loc1_.mTotalCount;
  657.    }
  658.    return _loc1_.items.length;
  659. };
  660. RecordSet.prototype.addProperty("length",RecordSet.prototype.getLength,null);
  661. RecordSet.prototype.getItemAt = function(index)
  662. {
  663.    var _loc1_ = index;
  664.    var _loc2_ = this;
  665.    if(_loc1_ < 0 || _loc1_ >= _loc2_.length)
  666.    {
  667.       return null;
  668.    }
  669.    if(_loc2_.mRecordSetID == null)
  670.    {
  671.       return _loc2_.items[_loc1_];
  672.    }
  673.    _loc2_.requestRecord(_loc1_);
  674.    var _loc3_ = _loc2_.items[_loc1_];
  675.    if(_loc3_ == 1)
  676.    {
  677.       return "in progress";
  678.    }
  679.    return _loc3_;
  680. };
  681. RecordSet.prototype.setField = function(index, fieldName, value)
  682. {
  683.    var _loc1_ = index;
  684.    var _loc2_ = this;
  685.    if(_loc2_.checkLocal())
  686.    {
  687.       if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
  688.       {
  689.          _loc2_.items[_loc1_][fieldName] = value;
  690.          _loc2_.updateViews({eventName:"updateItems",firstItem:_loc1_,lastItem:_loc1_});
  691.       }
  692.    }
  693. };
  694. RecordSet.prototype.filter = function(filterFunction, context)
  695. {
  696.    if(!this.checkLocal())
  697.    {
  698.    }
  699.    var _loc3_ = new RecordSet(this.mTitles);
  700.    var rcount = this.length;
  701.    var _loc2_ = 0;
  702.    while(_loc2_ < rcount)
  703.    {
  704.       var _loc1_ = this.getItemAt(_loc2_);
  705.       if(_loc1_ != null && _loc1_ != 1 && filterFunction(_loc1_,context))
  706.       {
  707.          _loc3_.addItem(_loc1_);
  708.       }
  709.       _loc2_ = _loc2_ + 1;
  710.    }
  711.    return _loc3_;
  712. };
  713. RecordSet.prototype.sort = function(compareFunc)
  714. {
  715.    var _loc1_ = this;
  716.    if(_loc1_.checkLocal())
  717.    {
  718.       _loc1_.items.sort(compareFunc);
  719.       _loc1_.updateViews({eventName:"sort"});
  720.    }
  721. };
  722. RecordSet.prototype.isLocal = function()
  723. {
  724.    return this.mRecordSetID == null;
  725. };
  726. RecordSet.prototype.isFullyPopulated = function()
  727. {
  728.    return this.isLocal();
  729. };
  730. RecordSet.prototype.getNumberAvailable = function()
  731. {
  732.    var _loc1_ = this;
  733.    if(_loc1_.isLocal())
  734.    {
  735.       return _loc1_.length;
  736.    }
  737.    return _loc1_.mRecordsAvailable;
  738. };
  739. RecordSet.prototype.setDeliveryMode = function(mode, pagesize, numPrefetchPages)
  740. {
  741.    var _loc1_ = this;
  742.    var _loc2_ = pagesize;
  743.    var _loc3_ = mode;
  744.    _loc1_.mDeliveryMode = _loc3_;
  745.    _loc1_.stopFetchAll();
  746.    if(_loc3_ != "ondemand")
  747.    {
  748.       if(_loc2_ == null)
  749.       {
  750.          _loc2_ = _loc1_.views[0].getRowCount();
  751.          if(_loc2_ == null)
  752.          {
  753.             _loc2_ = 25;
  754.          }
  755.       }
  756.       if(_loc3_ == "page")
  757.       {
  758.          if(numPrefetchPages == null)
  759.          {
  760.             numPrefetchPages = 0;
  761.          }
  762.          _loc1_.mPageSize = _loc2_;
  763.          _loc1_.mNumPrefetchPages = numPrefetchPages;
  764.       }
  765.       else if(_loc3_ == "fetchall")
  766.       {
  767.          _loc1_.stopFetchAll();
  768.          _loc1_.startFetchAll(_loc2_);
  769.       }
  770.       else
  771.       {
  772.          NetServices.trace("RecordSet","warning",107,"SetDeliveryMode: unknown mode string");
  773.       }
  774.    }
  775. };
  776. RecordSet.prototype.getRecords_Result = function(info)
  777. {
  778.    var _loc1_ = this;
  779.    var _loc2_ = info;
  780.    _loc1_.setData(_loc2_.Cursor - 1,_loc2_.Page);
  781.    _loc1_.mOutstandingRecordCount -= _loc2_.Page.length;
  782.    _loc1_.updateViews({eventName:"updateItems",firstItem:_loc2_.Cursor - 1,lastItem:_loc2_.Cursor - 1 + _loc2_.Page.length - 1});
  783.    if(_loc1_.mRecordsAvailable == _loc1_.mTotalCount && !_loc1_.mAllNotified)
  784.    {
  785.       _loc1_.updateViews({eventName:"allRows"});
  786.       _loc1_.mRecordSetService.release();
  787.       _loc1_.mAllNotified = true;
  788.       _loc1_.mRecordSetID = null;
  789.       _loc1_.mRecordSetService = null;
  790.    }
  791. };
  792. RecordSet.prototype.release_Result = function()
  793. {
  794. };
  795. RecordSet.prototype.arrayToObject = function(anArray)
  796. {
  797.    if(this.mTitles == null)
  798.    {
  799.       NetServices.trace("RecordSet","warning",105,"getItem: titles are not available");
  800.       return null;
  801.    }
  802.    var _loc3_ = new Object();
  803.    var alen = anArray.length;
  804.    var _loc1_ = 0;
  805.    while(_loc1_ < alen)
  806.    {
  807.       var _loc2_ = this.mTitles[_loc1_];
  808.       if(_loc2_ == null)
  809.       {
  810.          _loc2_ = "column" + _loc1_ + 1;
  811.       }
  812.       _loc3_[_loc2_] = anArray[_loc1_];
  813.       _loc1_ = _loc1_ + 1;
  814.    }
  815.    return _loc3_;
  816. };
  817. RecordSet.prototype.setData = function(start, dataArray)
  818. {
  819.    var _loc1_ = this;
  820.    var datalen = dataArray.length;
  821.    var _loc2_ = 0;
  822.    while(_loc2_ < datalen)
  823.    {
  824.       var _loc3_ = _loc2_ + start;
  825.       var rec = _loc1_.items[_loc3_];
  826.       if(rec != null && rec != 1)
  827.       {
  828.          NetServices.trace("RecordSet","warning",106,"Already got record # " + recordIndex);
  829.       }
  830.       else
  831.       {
  832.          _loc1_.mRecordsAvailable += 1;
  833.       }
  834.       _loc1_.items[_loc3_] = _loc1_.arrayToObject(dataArray[_loc2_]);
  835.       _loc1_.items[_loc3_].__ID__ = _loc1_.uniqueID++;
  836.       _loc2_ = _loc2_ + 1;
  837.    }
  838. };
  839. RecordSet.prototype.requestOneRecord = function(index)
  840. {
  841.    var _loc1_ = this;
  842.    var _loc2_ = index;
  843.    if(_loc1_.items[_loc2_] == null)
  844.    {
  845.       _loc1_.getRecordSetService().getRecords(_loc1_.mRecordSetID,_loc2_ + 1,1);
  846.       _loc1_.mOutstandingRecordCount = _loc1_.mOutstandingRecordCount + 1;
  847.       _loc1_.items[_loc2_] = 1;
  848.       _loc1_.updateViews({eventName:"fetchRows",firstItem:_loc2_,lastItem:_loc2_});
  849.    }
  850. };
  851. RecordSet.prototype.requestRecord = function(index)
  852. {
  853.    var _loc1_ = this;
  854.    if(_loc1_.mDeliveryMode != "page")
  855.    {
  856.       _loc1_.requestOneRecord(index);
  857.    }
  858.    else
  859.    {
  860.       var _loc2_ = int(index / _loc1_.mPageSize) * _loc1_.mPageSize;
  861.       var _loc3_ = _loc2_ + _loc1_.mPageSize * (_loc1_.mNumPrefetchPages + 1) - 1;
  862.       _loc1_.requestRecordRange(_loc2_,_loc3_);
  863.    }
  864. };
  865. RecordSet.prototype.requestRecordRange = function(index, lastIndex)
  866. {
  867.    var _loc1_ = index;
  868.    var _loc2_ = this;
  869.    var highestRequested = -1;
  870.    if(_loc1_ < 0)
  871.    {
  872.       _loc1_ = 0;
  873.    }
  874.    if(lastIndex >= _loc2_.length)
  875.    {
  876.       lastIndex = _loc2_.length - 1;
  877.    }
  878.    while(_loc1_ <= lastIndex)
  879.    {
  880.       while(_loc1_ <= lastIndex && _loc2_.items[_loc1_] != null)
  881.       {
  882.          _loc1_ = _loc1_ + 1;
  883.       }
  884.       var _loc3_ = _loc1_;
  885.       while(_loc1_ <= lastIndex && _loc2_.items[_loc1_] == null)
  886.       {
  887.          _loc2_.mOutstandingRecordCount = _loc2_.mOutstandingRecordCount + 1;
  888.          _loc2_.items[_loc1_] = 1;
  889.          _loc1_ = _loc1_ + 1;
  890.       }
  891.       var last = _loc1_ - 1;
  892.       if(_loc3_ <= last)
  893.       {
  894.          _loc2_.getRecordSetService().getRecords(_loc2_.mRecordSetID,_loc3_ + 1,last - _loc3_ + 1);
  895.          highestRequested = last;
  896.          _loc2_.updateViews({eventName:"fetchRows",firstItem:_loc3_,lastItem:last});
  897.       }
  898.    }
  899.    return highestRequested;
  900. };
  901. RecordSet.prototype.startFetchAll = function(pagesize)
  902. {
  903.    var _loc1_ = this;
  904.    _loc1_.mDataFetcher.disable();
  905.    _loc1_.mDataFetcher = new RsDataFetcher(_loc1_,pagesize);
  906. };
  907. RecordSet.prototype.stopFetchAll = function()
  908. {
  909.    this.mDataFetcher.disable();
  910.    this.mDataFetcher = null;
  911. };
  912. RecordSet.prototype.checkLocal = function()
  913. {
  914.    if(this.isLocal())
  915.    {
  916.       return true;
  917.    }
  918.    NetServices.trace("RecordSet","warning",108,"Operation not allowed on partial recordset");
  919.    return false;
  920. };
  921. _global.RsDataFetcher = function(recordSet, increment)
  922. {
  923.    var _loc1_ = this;
  924.    _loc1_.mRecordSet = recordSet;
  925.    _loc1_.mRecordSet.addView(_loc1_);
  926.    _loc1_.mIncrement = increment;
  927.    _loc1_.mNextRecord = 0;
  928.    _loc1_.mEnabled = true;
  929.    _loc1_.doNext();
  930. };
  931. RsDataFetcher.prototype.disable = function()
  932. {
  933.    var _loc1_ = this;
  934.    _loc1_.mEnabled = false;
  935.    _loc1_.mRecordSet.removeView(_loc1_);
  936. };
  937. RsDataFetcher.prototype.doNext = function()
  938. {
  939.    var _loc1_ = this;
  940.    if(_loc1_.mEnabled)
  941.    {
  942.       while(true)
  943.       {
  944.          if(_loc1_.mNextRecord >= _loc1_.mRecordSet.length)
  945.          {
  946.             break;
  947.          }
  948.          _loc1_.mHighestRequested = _loc1_.mRecordSet.requestRecordRange(_loc1_.mNextRecord,_loc1_.mNextRecord + _loc1_.mIncrement - 1);
  949.          _loc1_.mNextRecord += _loc1_.mIncrement;
  950.          if(_loc1_.mHighestRequested > 0)
  951.          {
  952.             break;
  953.          }
  954.       }
  955.    }
  956. };
  957. RsDataFetcher.prototype.modelChanged = function(eventObj)
  958. {
  959.    var _loc1_ = this;
  960.    var _loc2_ = eventObj;
  961.    if(_loc2_.eventName == "updateItems" && _loc2_.firstItem <= _loc1_.mHighestRequested && _loc2_.lastItem >= _loc1_.mHighestRequested)
  962.    {
  963.       _loc1_.doNext();
  964.    }
  965.    if(_loc2_.eventName == "allRows")
  966.    {
  967.       _loc1_.disable();
  968.    }
  969. };
  970. _global.NetServiceProxyResponder = function(service, methodName)
  971. {
  972.    this.service = service;
  973.    this.methodName = methodName;
  974. };
  975. NetServiceProxyResponder.prototype.onResult = function(result)
  976. {
  977.    var _loc3_ = result;
  978.    var _loc1_ = this.service.client;
  979.    _loc3_._setParentService(this.service);
  980.    var _loc2_ = this.methodName + "_Result";
  981.    if(typeof _loc1_[_loc2_] == "function")
  982.    {
  983.       _loc1_[_loc2_](_loc3_);
  984.    }
  985.    else if(typeof _loc1_.onResult == "function")
  986.    {
  987.       _loc1_.onResult(_loc3_);
  988.    }
  989.    else
  990.    {
  991.       NetServices.trace("NetServices","info",1,_loc2_ + " was received from server: " + _loc3_);
  992.    }
  993. };
  994. NetServiceProxyResponder.prototype.onStatus = function(result)
  995. {
  996.    var _loc1_ = result;
  997.    var _loc2_ = this.service.client;
  998.    var _loc3_ = this.methodName + "_Status";
  999.    if(typeof _loc2_[_loc3_] == "function")
  1000.    {
  1001.       _loc2_[_loc3_](_loc1_);
  1002.    }
  1003.    else if(typeof _loc2_.onStatus == "function")
  1004.    {
  1005.       _loc2_.onStatus(_loc1_);
  1006.    }
  1007.    else if(typeof _root.onStatus == "function")
  1008.    {
  1009.       _root.onStatus(_loc1_);
  1010.    }
  1011.    else if(typeof _global.System.onStatus == "function")
  1012.    {
  1013.       _global.System.onStatus(_loc1_);
  1014.    }
  1015.    else
  1016.    {
  1017.       NetServices.trace("NetServices","info",2,_loc3_ + " was received from server: <" + _loc1_.level + "> " + _loc1_.description);
  1018.    }
  1019. };
  1020. _global.NetServiceProxy = function(nc, serviceName, client)
  1021. {
  1022.    var _loc1_ = this;
  1023.    if(nc != null)
  1024.    {
  1025.       _loc1_.nc = nc;
  1026.       _loc1_.serviceName = serviceName;
  1027.       _loc1_.client = client;
  1028.    }
  1029. };
  1030. NetServiceProxy.prototype._setParentService = function(service)
  1031. {
  1032.    this.nc = service.nc;
  1033.    this.client = service.client;
  1034. };
  1035. NetServiceProxy.prototype.__resolve = function(methodName)
  1036. {
  1037.    var _loc1_ = this;
  1038.    var _loc2_ = arguments;
  1039.    var _loc3_ = function()
  1040.    {
  1041.       var _loc1_ = this;
  1042.       var _loc2_ = arguments;
  1043.       if(_loc1_.client != null)
  1044.       {
  1045.          _loc2_.unshift(new NetServiceProxyResponder(_loc1_,methodName));
  1046.       }
  1047.       else if(typeof _loc2_[0].onResult != "function")
  1048.       {
  1049.          NetServices.trace("NetServices","warning",3,"There is no defaultResponder, but no responder was given in call to " + methodName);
  1050.          _loc2_.unshift(new NetServiceProxyResponder(_loc1_,methodName));
  1051.       }
  1052.       _loc2_.unshift(_loc1_.serviceName + "." + methodName);
  1053.       return _loc1_.nc.call.apply(_loc1_.nc,_loc2_);
  1054.    };
  1055.    return _loc3_;
  1056. };
  1057. Object.registerClass("NetServiceProxy",NetServiceProxy);
  1058. NetConnection.prototype.getService = function(serviceName, client)
  1059. {
  1060.    var _loc1_ = new NetServiceProxy(this,serviceName,client);
  1061.    return _loc1_;
  1062. };
  1063. NetConnection.prototype.setCredentials = function(userid, password)
  1064. {
  1065.    this.addHeader("Credentials",false,{userid:userid,password:password});
  1066. };
  1067. NetConnection.prototype.RequestPersistentHeader = function(info)
  1068. {
  1069.    var _loc1_ = info;
  1070.    this.addHeader(_loc1_.name,_loc1_.mustUnderstand,_loc1_.data);
  1071. };
  1072. NetConnection.prototype.AppendToGatewayUrl = function(urlSuffix)
  1073. {
  1074.    var _loc1_ = this;
  1075.    _loc1_.__urlSuffix = urlSuffix;
  1076.    if(_loc1_.__originalUrl == null)
  1077.    {
  1078.       _loc1_.__originalUrl = _loc1_.uri;
  1079.    }
  1080.    var _loc2_ = _loc1_.__originalUrl + urlSuffix;
  1081.    _loc1_.connect(_loc2_);
  1082. };
  1083. NetConnection.prototype.ReplaceGatewayUrl = function(newUrl)
  1084. {
  1085.    this.connect(newUrl);
  1086. };
  1087. NetConnection.prototype.clone = function()
  1088. {
  1089.    var _loc1_ = new NetConnection();
  1090.    _loc1_.connect(this.uri);
  1091.    return _loc1_;
  1092. };
  1093. if(_global.NetServices == null)
  1094. {
  1095.    _global.NetServices = new Object();
  1096.    NetServices.gatewayUrl = gatewayUrl;
  1097. }
  1098. NetServices.setDefaultGatewayUrl = function(url)
  1099. {
  1100.    NetServices.defaultGatewayUrl = url;
  1101. };
  1102. NetServices.setGatewayUrl = function(url)
  1103. {
  1104.    NetServices.gatewayUrl = url;
  1105. };
  1106. NetServices.createGatewayConnection = function(url)
  1107. {
  1108.    var _loc1_ = url;
  1109.    if(_loc1_ == undefined)
  1110.    {
  1111.       _loc1_ = NetServices.gatewayUrl;
  1112.       if(_loc1_ == undefined)
  1113.       {
  1114.          _loc1_ = NetServices.defaultGatewayUrl;
  1115.       }
  1116.    }
  1117.    if(_loc1_ == undefined)
  1118.    {
  1119.       NetServices.trace("NetServices","warning",4,"createGatewayConnection - gateway url is undefined");
  1120.       return null;
  1121.    }
  1122.    var _loc2_ = new NetConnection();
  1123.    _loc2_.connect(_loc1_);
  1124.    return _loc2_;
  1125. };
  1126. NetServices.getHostUrl = function()
  1127. {
  1128.    var _loc2_ = _root;
  1129.    if(!NetServices.isHttpUrl(_loc2_._url))
  1130.    {
  1131.       return null;
  1132.    }
  1133.    var _loc1_ = _loc2_._url.indexOf("/",8);
  1134.    if(_loc1_ < 0)
  1135.    {
  1136.       return null;
  1137.    }
  1138.    return _loc2_._url.substring(0,_loc1_);
  1139. };
  1140. NetServices.isHttpUrl = function(url)
  1141. {
  1142.    return url.indexOf("http://") == 0 || url.indexOf("https://") == 0;
  1143. };
  1144. NetServices.trace = function(who, severity, number, message)
  1145. {
  1146.    var _loc1_ = who + " " + severity + " " + number + ": " + message;
  1147.    trace(_loc1_);
  1148.    NetDebug.traceNetServices(who,severity,number,message);
  1149. };
  1150. NetServices.getVersion = function()
  1151. {
  1152.    return 1;
  1153. };
  1154. _global.copyProperties = function(to, from)
  1155. {
  1156.    var _loc1_ = from;
  1157.    var _loc2_ = to;
  1158.    for(var _loc3_ in _loc1_)
  1159.    {
  1160.       if(!(_loc3_ == "__proto__" || _loc3_ == "function"))
  1161.       {
  1162.          if(typeof _loc1_[_loc3_] == "object")
  1163.          {
  1164.             if(_loc2_[_loc3_] == undefined)
  1165.             {
  1166.                _loc2_[_loc3_] = new _loc1_[_loc3_].__proto__.constructor();
  1167.             }
  1168.             copyProperties(_loc2_[_loc3_],_loc1_[_loc3_]);
  1169.          }
  1170.          else
  1171.          {
  1172.             _loc2_[_loc3_] = _loc1_[_loc3_];
  1173.          }
  1174.       }
  1175.    }
  1176. };
  1177. _global.copyObject = function(obj)
  1178. {
  1179.    var _loc2_ = obj;
  1180.    if(typeof _loc2_ == "object")
  1181.    {
  1182.       var _loc1_ = new _loc2_.__proto__.constructor();
  1183.       copyProperties(_loc1_,_loc2_);
  1184.       return _loc1_;
  1185.    }
  1186.    return _loc2_;
  1187. };
  1188. _global.objectToStringTree = function(obj, openstr, typesepstr, valuesepstr, closestr)
  1189. {
  1190.    var _loc1_ = new StringLineAdder(obj,new TreeLineRenderer(openstr != null ? openstr : "{",typesepstr != null ? typesepstr : ":",valuesepstr != null ? valuesepstr : ", ",closestr != null ? closestr : "}"));
  1191.    return _loc1_.getString();
  1192. };
  1193. _global.objectToListboxTree = function(listbox, obj, openstr, typesepstr, valuesepstr, closestr)
  1194. {
  1195.    new ListLineAdder(listbox,obj,new TreeLineRenderer(openstr != null ? openstr : "{",typesepstr != null ? typesepstr : ":",valuesepstr != null ? valuesepstr : ", ",closestr != null ? closestr : "}"));
  1196. };
  1197. _global.StringLineAdder = function(obj, renderer)
  1198. {
  1199.    var _loc1_ = this;
  1200.    _loc1_.linerenderer = renderer;
  1201.    _loc1_.output = "";
  1202.    nestedObjectDump(0,null,obj,_loc1_);
  1203. };
  1204. StringLineAdder.prototype.getString = function()
  1205. {
  1206.    return this.output;
  1207. };
  1208. StringLineAdder.prototype.addLine = function(level, objname, objtype, objvalue, objnum)
  1209. {
  1210.    var _loc1_ = this.linerenderer.getLine(level,objname,objtype,objvalue,objnum);
  1211.    if(_loc1_ != null)
  1212.    {
  1213.       this.output += _loc1_ + "\n";
  1214.    }
  1215.    return true;
  1216. };
  1217. _global.ListLineAdder = function(listbox, obj, renderer)
  1218. {
  1219.    var _loc1_ = this;
  1220.    _loc1_.linerenderer = renderer;
  1221.    _loc1_.output_lb = listbox;
  1222.    nestedObjectDump(0,null,obj,_loc1_);
  1223. };
  1224. ListLineAdder.prototype.addLine = function(level, objname, objtype, objvalue, objnum)
  1225. {
  1226.    var _loc1_ = this.linerenderer.getLine(level,objname,objtype,objvalue,objnum);
  1227.    if(_loc1_ != null)
  1228.    {
  1229.       this.output_lb.addItem(_loc1_);
  1230.    }
  1231.    return true;
  1232. };
  1233. _global.TreeLineRenderer = function(pre, typedelim, valuedelim, post)
  1234. {
  1235.    this.init(pre,typedelim,valuedelim,post);
  1236. };
  1237. TreeLineRenderer.prototype.init = function(pre, typedelim, valuedelim, post)
  1238. {
  1239.    var _loc1_ = this;
  1240.    _loc1_.prechar = pre;
  1241.    _loc1_.typechar = typedelim;
  1242.    _loc1_.valuechar = valuedelim;
  1243.    _loc1_.postchar = post;
  1244. };
  1245. TreeLineRenderer.prototype.getLine = function(level, objname, objtype, objvalue, objnum)
  1246. {
  1247.    var _loc3_ = this;
  1248.    var _loc2_ = "";
  1249.    var _loc1_ = 0;
  1250.    while(_loc1_ < level)
  1251.    {
  1252.       _loc2_ += "\t";
  1253.       _loc1_ = _loc1_ + 1;
  1254.    }
  1255.    var valuedelim = _loc3_.valuechar;
  1256.    if(objname != null && objtype != "object")
  1257.    {
  1258.       _loc2_ += _loc3_.prechar + objtype + _loc3_.typechar + objname;
  1259.    }
  1260.    else if(objtype == "object")
  1261.    {
  1262.       if(typeof objvalue == "number")
  1263.       {
  1264.          _loc2_ += _loc3_.prechar + objtype + _loc3_.typechar + objname;
  1265.          _loc2_ += valuedelim + "object#" + objvalue;
  1266.          objvalue = null;
  1267.       }
  1268.       else
  1269.       {
  1270.          _loc2_ += _loc3_.prechar + objtype + "#" + objnum + _loc3_.typechar + objname;
  1271.       }
  1272.    }
  1273.    else
  1274.    {
  1275.       _loc2_ += _loc3_.prechar + objtype;
  1276.       valuedelim = _loc3_.typechar;
  1277.    }
  1278.    if(objvalue != null)
  1279.    {
  1280.       _loc2_ += valuedelim + objvalue;
  1281.    }
  1282.    _loc2_ += _loc3_.postchar;
  1283.    return _loc2_;
  1284. };
  1285. _global.nestedObjectDump = function(level, objname, obj, lineadder)
  1286. {
  1287.    var _loc1_ = obj;
  1288.    if(level == 0)
  1289.    {
  1290.       nestedObjectDump.callcount = nestedObjectDump.callcount + 1;
  1291.       nestedObjectDump.objcount = -1;
  1292.    }
  1293.    if(_loc1_ == null)
  1294.    {
  1295.       return lineadder.addLine(level,objname,"undefined");
  1296.    }
  1297.    if(typeof _loc1_ == "function")
  1298.    {
  1299.       return lineadder.addLine(level,objname,"function");
  1300.    }
  1301.    if(typeof _loc1_ == "object")
  1302.    {
  1303.       if(_loc1_.__nestedObjectDump_id != undefined && _loc1_.__nestedObjectDump_ref == nestedObjectDump.callcount)
  1304.       {
  1305.          return lineadder.addLine(level,objname,"object",_loc1_.__nestedObjectDump_id);
  1306.       }
  1307.       nestedObjectDump.objcount = nestedObjectDump.objcount + 1;
  1308.       if(lineadder.addLine(level,objname,"object",null,nestedObjectDump.objcount) == nestedObjectDump.skip)
  1309.       {
  1310.          return nestedObjectDump.proceed;
  1311.       }
  1312.       _loc1_.__nestedObjectDump_id = nestedObjectDump.objcount;
  1313.       _loc1_.__nestedObjectDump_ref = nestedObjectDump.callcount;
  1314.       var props = new Array();
  1315.       var _loc3_ = new Array();
  1316.       for(var prop in _loc1_)
  1317.       {
  1318.          if(!(prop == "__proto__" || prop == "__nestedObjectDump_id" || prop == "__nestedObjectDump_ref"))
  1319.          {
  1320.             if(typeof _loc1_[prop] == "object")
  1321.             {
  1322.                _loc3_.push(prop);
  1323.             }
  1324.             else
  1325.             {
  1326.                props.push(prop);
  1327.             }
  1328.          }
  1329.       }
  1330.       if(_loc3_.length == 0 && props.length == 0)
  1331.       {
  1332.          if(typeof _loc1_.toString == "function" && _loc1_.toString() != "")
  1333.          {
  1334.             return lineadder.addLine(level + 1,null,"string",_loc1_.toString());
  1335.          }
  1336.          if(lineadder.noProps != undefined)
  1337.          {
  1338.             lineadder.noProps(level + 1);
  1339.             return nestedObjectDump.proceed;
  1340.          }
  1341.       }
  1342.       props.sort();
  1343.       _loc3_.sort();
  1344.       var bret = true;
  1345.       var plen = props.length;
  1346.       var _loc2_ = 0;
  1347.       while(_loc2_ < plen)
  1348.       {
  1349.          if(nestedObjectDump(level + 1,props[_loc2_],_loc1_[props[_loc2_]],lineadder) == nestedObjectDump.stop)
  1350.          {
  1351.             bret = false;
  1352.             break;
  1353.          }
  1354.          _loc2_ = _loc2_ + 1;
  1355.       }
  1356.       if(bret)
  1357.       {
  1358.          var olen = _loc3_.length;
  1359.          _loc2_ = 0;
  1360.          while(_loc2_ < olen)
  1361.          {
  1362.             if(!nestedObjectDump(level + 1,_loc3_[_loc2_],_loc1_[_loc3_[_loc2_]],lineadder))
  1363.             {
  1364.                bret = false;
  1365.             }
  1366.             _loc2_ = _loc2_ + 1;
  1367.          }
  1368.       }
  1369.       return nestedObjectDump.proceed;
  1370.    }
  1371.    return lineadder.addLine(level,objname,typeof _loc1_,_loc1_);
  1372. };
  1373. nestedObjectDump.proceed = 1;
  1374. nestedObjectDump.skip = 2;
  1375. nestedObjectDump.stop = 3;
  1376. nestedObjectDump.callcount = 0;
  1377. nestedObjectDump.objcount = 0;
  1378. Object.registerClass("NetDebugConfig",NetDebugConfig);
  1379. NetDebugEvent.prototype.init = function()
  1380. {
  1381.    var _loc1_ = this;
  1382.    _loc1_.EventType = "DebugEvent";
  1383.    _loc1_.Source = "Client";
  1384.    _loc1_.MovieUrl = unescape(_root._url);
  1385.    _loc1_.initDate();
  1386. };
  1387. NetDebugEvent.prototype.initDate = function()
  1388. {
  1389.    var _loc1_ = new Date();
  1390.    this.Date = _loc1_;
  1391.    this.Time = _loc1_.getTime();
  1392. };
  1393. NetDebugErrorEvent.prototype = new NetDebugEvent();
  1394. NetDebugTraceEvent.prototype = new NetDebugEvent();
  1395. NetDebugTraceNetServicesEvent.prototype = new NetDebugEvent();
  1396. NetDebugNCEvent.prototype = new NetDebugEvent();
  1397. NetDebugResultEvent.prototype = new NetDebugNCEvent();
  1398. NetDebugStatusEvent.prototype = new NetDebugNCEvent();
  1399. NetDebugConnectEvent.prototype = new NetDebugNCEvent();
  1400. NetDebugCallEvent.prototype = new NetDebugNCEvent();
  1401. NetDebugCloseEvent.prototype = new NetDebugNCEvent();
  1402. NetDebugAddHeaderEvent.prototype = new NetDebugNCEvent();
  1403. NetDebugRtmpLogEvent.prototype = new NetDebugNCEvent();
  1404. NetDebugDuplicateNCDErrorEvent.prototype = new NetDebugNCEvent();
  1405. NetDebugFailedSendErrorEvent.prototype = new NetDebugNCEvent();
  1406. NetDebugInfoErrorEvent.prototype = new NetDebugNCEvent();
  1407. NetDebugResultEvent.prototype = new NetDebugNCEvent();
  1408. _global.StripNCDEventToMinmal = function(ev)
  1409. {
  1410.    var _loc1_ = ev;
  1411.    var _loc2_ = new Object();
  1412.    if(_loc1_.EventType != null)
  1413.    {
  1414.       _loc2_.EventType = _loc1_.EventType;
  1415.    }
  1416.    if(_loc1_.Source != null)
  1417.    {
  1418.       _loc2_.Source = _loc1_.Source;
  1419.    }
  1420.    if(_loc1_.MovieUrl != null)
  1421.    {
  1422.       _loc2_.MovieUrl = _loc1_.MovieUrl;
  1423.    }
  1424.    if(_loc1_.Date != null)
  1425.    {
  1426.       _loc2_.Date = _loc1_.Date;
  1427.    }
  1428.    if(_loc1_.Time != null)
  1429.    {
  1430.       _loc2_.Time = _loc1_.Time;
  1431.    }
  1432.    if(_loc1_.Protocol != null)
  1433.    {
  1434.       _loc2_.Protocol = _loc1_.Protocol;
  1435.    }
  1436.    if(_loc1_.DebugId != null)
  1437.    {
  1438.       _loc2_.DebugId = _loc1_.DebugId;
  1439.    }
  1440.    return _loc2_;
  1441. };
  1442. NetConnection.prototype.attachDebug = function()
  1443. {
  1444.    var _loc1_ = this;
  1445.    if(!_loc1_.m_Attached)
  1446.    {
  1447.       _loc1_.m_Attached = true;
  1448.       _loc1_.m_HeaderAdded = false;
  1449.       _loc1_.m_Config = new NetDebugConfig();
  1450.       copyProperties(_loc1_.m_Config,getNetDebug().m_Config);
  1451.       _loc1_.m_Protocol = "none";
  1452.       _loc1_.m_Id = getNetDebug().addNetConnection(_loc1_);
  1453.    }
  1454. };
  1455. NetConnection.prototype.sendDebugEvent = function(eventobj)
  1456. {
  1457.    var _loc1_ = eventobj;
  1458.    _loc1_.Protocol = this.m_Protocol;
  1459.    _loc1_.DebugId = this.m_Id;
  1460.    return getNetDebug().onEvent(_loc1_);
  1461. };
  1462. NetConnection.prototype.sendServerEvent = function(eventobj)
  1463. {
  1464.    eventobj.MovieUrl = unescape(_root._url);
  1465.    if(this.sendDebugEvent(eventobj))
  1466.    {
  1467.    }
  1468. };
  1469. NetConnection.prototype.sendClientEvent = function(eventobj)
  1470. {
  1471.    var _loc1_ = this;
  1472.    if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug)
  1473.    {
  1474.       if(_loc1_.m_Config.client.http && _loc1_.m_Protocol == "http" || _loc1_.m_Config.client.rtmp && _loc1_.m_Protocol.substr(0,4) == "rtmp")
  1475.       {
  1476.          if(_loc1_.sendDebugEvent(eventobj))
  1477.          {
  1478.          }
  1479.       }
  1480.    }
  1481. };
  1482. NetConnection.prototype.addNetDebugHeader = function()
  1483. {
  1484.    var _loc1_ = this;
  1485.    if(!_loc1_.m_HeaderAdded)
  1486.    {
  1487.       _loc1_.m_HeaderAdded = true;
  1488.       if(_loc1_.m_Config.m_debug && _loc1_.m_Config.app_server.m_debug && _loc1_.m_Protocol == "http")
  1489.       {
  1490.          _loc1_.realaddHeader("amf_server_debug",true,_loc1_.m_Config.app_server);
  1491.       }
  1492.       else
  1493.       {
  1494.          _loc1_.realaddHeader("amf_server_debug",true,undefined);
  1495.       }
  1496.    }
  1497. };
  1498. NetConnection.prototype.updateConfig = function(config)
  1499. {
  1500.    var _loc1_ = this;
  1501.    _loc1_.attachDebug();
  1502.    copyProperties(_loc1_.m_Config,config);
  1503.    _loc1_.m_HeaderAdded = false;
  1504. };
  1505. NetConnection.prototype.isRealTime = function()
  1506. {
  1507.    return this.m_Protocol.substr(0,4) == "rtmp";
  1508. };
  1509. NetConnection.prototype.setupRecordset = function()
  1510. {
  1511.    var _loc1_ = this;
  1512.    _loc1_.attachDebug();
  1513.    _loc1_.m_Config.client.http = _loc1_.m_Config.client.recordset;
  1514. };
  1515. NetConnection.prototype.setDebugId = function(id)
  1516. {
  1517.    this.attachDebug();
  1518.    this.m_Id = id;
  1519. };
  1520. NetConnection.prototype.getDebugId = function()
  1521. {
  1522.    this.attachDebug();
  1523.    return this.m_Id;
  1524. };
  1525. NetConnection.prototype.trace = function(traceobj)
  1526. {
  1527.    var _loc1_ = this;
  1528.    _loc1_.attachDebug();
  1529.    if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
  1530.    {
  1531.       _loc1_.sendDebugEvent(new NetDebugTraceEvent(traceobj));
  1532.    }
  1533. };
  1534. NetConnection.prototype.getDebugConfig = function()
  1535. {
  1536.    this.attachDebug();
  1537.    return this.m_Config;
  1538. };
  1539. if(!NetConnection.prototype.netDebugProxyFunctions)
  1540. {
  1541.    NetConnection.prototype.netDebugProxyFunctions = true;
  1542.    NetConnection.prototype.realconnect = NetConnection.prototype.connect;
  1543.    NetConnection.prototype.realcall = NetConnection.prototype.call;
  1544.    NetConnection.prototype.realclose = NetConnection.prototype.close;
  1545.    NetConnection.prototype.realaddHeader = NetConnection.prototype.addHeader;
  1546.    NetConnection.prototype.connect = netDebugProxyConnect;
  1547.    NetConnection.prototype.call = netDebugProxyCall;
  1548.    NetConnection.prototype.close = netDebugProxyClose;
  1549.    NetConnection.prototype.addHeader = netDebugProxyAddHeader;
  1550. }
  1551. RTMPClientIDResponse.prototype.onResult = function(cid)
  1552. {
  1553.    this.m_NC.m_ClientId = cid;
  1554.    getNetDebug().sendCommand(new AddRTMPClientCommand(this.m_ConnectString,cid));
  1555. };
  1556. NetDebugResponseProxy.prototype.onDebugEvents = function(debugevents)
  1557. {
  1558.    var _loc3_ = debugevents;
  1559.    var _loc2_ = _loc3_.length;
  1560.    var _loc1_ = 0;
  1561.    while(_loc1_ < _loc2_)
  1562.    {
  1563.       this.m_SourceNC.sendServerEvent(_loc3_[_loc1_]);
  1564.       _loc1_ = _loc1_ + 1;
  1565.    }
  1566. };
  1567. NetDebugResponseProxy.prototype.onResult = function(resultobj)
  1568. {
  1569.    this.m_SourceNC.sendClientEvent(new NetDebugResultEvent(resultobj));
  1570.    this.m_OriginalNR.onResult(resultobj);
  1571. };
  1572. NetDebugResponseProxy.prototype.onStatus = function(statusobj)
  1573. {
  1574.    var _loc1_ = this;
  1575.    var _loc2_ = statusobj;
  1576.    _loc1_.m_SourceNC.sendClientEvent(new NetDebugStatusEvent(_loc2_));
  1577.    if(_loc1_.m_OriginalNR.onStatus != undefined)
  1578.    {
  1579.       _loc1_.m_OriginalNR.onStatus(_loc2_);
  1580.    }
  1581.    else
  1582.    {
  1583.       _global.System.onStatus(_loc2_);
  1584.    }
  1585. };
  1586. NetDebugResponseProxy.prototype.__resolve = function(name)
  1587. {
  1588.    this.m_SourceNC.sendClientEvent(new NetDebugReceiveCallEvent(name,arguments));
  1589.    this.m_OriginalNR[name].apply(arguments);
  1590. };
  1591. GlobalLocalConnection.prototype.setDomainName = function(domainname)
  1592. {
  1593.    var _loc1_ = domainname;
  1594.    if(_loc1_ != null && _loc1_ != "")
  1595.    {
  1596.       this.sendPrefix = _loc1_ + ":";
  1597.    }
  1598.    else
  1599.    {
  1600.       this.sendPrefix = "";
  1601.    }
  1602. };
  1603. GlobalLocalConnection.prototype.send = function(dataobj)
  1604. {
  1605.    return this.sendRaw("onData",dataobj);
  1606. };
  1607. GlobalLocalConnection.prototype.sendCommand = function(commandobj)
  1608. {
  1609.    return this.sendRaw("onCommand",commandobj);
  1610. };
  1611. GlobalLocalConnection.prototype.sendRaw = function(functionname, obj)
  1612. {
  1613.    var _loc2_ = this;
  1614.    var _loc3_ = true;
  1615.    var snlen = _loc2_.sendnames.length;
  1616.    var _loc1_ = 0;
  1617.    while(_loc1_ < snlen)
  1618.    {
  1619.       _loc3_ &= _global.g_NetDebugLocalConnection.send(_loc2_.sendPrefix + _loc2_.sendnames[_loc1_],functionname,obj);
  1620.       _loc1_ = _loc1_ + 1;
  1621.    }
  1622.    return _loc3_;
  1623. };
  1624. LocalCommand.prototype.init = function(commandname, dataobj)
  1625. {
  1626.    this.command = commandname;
  1627.    this.data = dataobj;
  1628. };
  1629. UpdateNetDebugConfigCommand.prototype = new LocalCommand();
  1630. GetConfigCommand.prototype = new LocalCommand();
  1631. StartRTMPTraceCommand.prototype = new LocalCommand();
  1632. AddRTMPClientCommand.prototype = new LocalCommand();
  1633. StopRTMPTraceCommand.prototype = new LocalCommand();
  1634. NetDebug.prototype.addNetConnection = function(nc)
  1635. {
  1636.    this.m_ncs.push(nc);
  1637.    return this.m_NextNewId++;
  1638. };
  1639. NetDebug.prototype.removeNetConnection = function(nc)
  1640. {
  1641.    var _loc2_ = this;
  1642.    var _loc3_ = _loc2_.m_ncs.length;
  1643.    var _loc1_ = 0;
  1644.    while(_loc1_ < _loc3_)
  1645.    {
  1646.       if(nc == _loc2_.m_ncs[_loc1_])
  1647.       {
  1648.          _loc2_.m_ncs.splice(_loc1_,1);
  1649.          break;
  1650.       }
  1651.       _loc1_ = _loc1_ + 1;
  1652.    }
  1653. };
  1654. NetDebug.prototype.sendDebugEvent = function(eventobj)
  1655. {
  1656.    if(!this.m_glc.send(eventobj))
  1657.    {
  1658.       this.m_glc.send(new NetDebugFailedSendErrorEvent(StripNCDEventToMinmal(eventobj)));
  1659.       return false;
  1660.    }
  1661.    return true;
  1662. };
  1663. NetDebug.prototype.sendCommand = function(commandobj)
  1664. {
  1665.    return this.m_glc.sendCommand(commandobj);
  1666. };
  1667. NetDebug.prototype.requestNewConfig = function()
  1668. {
  1669.    return this.sendCommand(new GetConfigCommand());
  1670. };
  1671. NetDebug.prototype.updateConfig = function(config)
  1672. {
  1673.    var _loc2_ = this;
  1674.    copyProperties(_loc2_.m_Config,config);
  1675.    var _loc3_ = _loc2_.m_ncs.length;
  1676.    var _loc1_ = 0;
  1677.    while(_loc1_ < _loc3_)
  1678.    {
  1679.       if(_loc2_.m_ncs[_loc1_] != null)
  1680.       {
  1681.          _loc2_.m_ncs[_loc1_].updateConfig(config);
  1682.       }
  1683.       _loc1_ = _loc1_ + 1;
  1684.    }
  1685. };
  1686. NetDebug.prototype.sendStatus = function(statusobj)
  1687. {
  1688.    var _loc1_ = this;
  1689.    if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug)
  1690.    {
  1691.       return _loc1_.m_glc.send(new NetDebugStatusEvent(statusobj));
  1692.    }
  1693. };
  1694. NetDebug.prototype.onEvent = function(eventobj)
  1695. {
  1696.    return this.sendDebugEvent(eventobj);
  1697. };
  1698. NetDebug.prototype.onEventError = function(errorobj)
  1699. {
  1700.    return this.sendDebugEvent(new NetDebugErrorEvent(errorobj));
  1701. };
  1702. NetDebug.prototype.onReceiveCommand = function(commandobj)
  1703. {
  1704.    this[commandobj.command](commandobj.data);
  1705. };
  1706. NetDebug.prototype.onReceiveError = function(errorobj)
  1707. {
  1708.    this.sendDebugEvent(new NetDebugErrorEvent(errorobj));
  1709. };
  1710. NetDebug.prototype.traceNetServices = function(who, severity, number, message)
  1711. {
  1712.    var _loc1_ = this;
  1713.    if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
  1714.    {
  1715.       if(_loc1_.sendDebugEvent(new NetDebugTraceNetServicesEvent(who,severity,number,message)))
  1716.       {
  1717.       }
  1718.    }
  1719. };
  1720. NetDebug.prototype.trace = function(traceobj)
  1721. {
  1722.    var _loc1_ = this;
  1723.    if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
  1724.    {
  1725.       if(_loc1_.sendDebugEvent(new NetDebugTraceEvent(traceobj)))
  1726.       {
  1727.       }
  1728.    }
  1729. };
  1730. if(_global.netDebugInstance == undefined)
  1731. {
  1732.    _global.netDebugInstance = new NetDebug();
  1733. }
  1734. NetDebug.trace = function(obj)
  1735. {
  1736.    getNetDebug().trace(obj);
  1737. };
  1738. NetDebug.traceNetServices = function(who, severity, number, message)
  1739. {
  1740.    getNetDebug().traceNetServices(who,severity,number,message);
  1741. };
  1742. NetDebug.getVersion = function()
  1743. {
  1744.    return getNetDebugVersion();
  1745. };
  1746. NetDebug.globalOnStatus = function(statusobj)
  1747. {
  1748.    getNetDebug().sendStatus(statusobj);
  1749. };
  1750. if(_global.System.onStatus == undefined)
  1751. {
  1752.    _global.System.onStatus = NetDebug.globalOnStatus;
  1753. }
  1754. _global.DataGlue = function(dataProvider)
  1755. {
  1756.    this.dataProvider = dataProvider;
  1757. };
  1758. _global.DataGlue.bindFormatStrings = function(dataConsumer, dataProvider, labelString, dataString)
  1759. {
  1760.    var _loc1_ = new DataGlue(dataProvider);
  1761.    _loc1_.labelString = labelString;
  1762.    _loc1_.dataString = dataString;
  1763.    _loc1_.getItemAt = _global.DataGlue.getItemAt_FormatString;
  1764.    dataConsumer.setDataProvider(_loc1_);
  1765. };
  1766. _global.DataGlue.bindFormatFunction = function(dataConsumer, dataProvider, formatFunction)
  1767. {
  1768.    var _loc1_ = new DataGlue(dataProvider);
  1769.    _loc1_.formatFunction = formatFunction;
  1770.    _loc1_.getItemAt = _global.DataGlue.getItemAt_FormatFunction;
  1771.    dataConsumer.setDataProvider(_loc1_);
  1772. };
  1773. _global.DataGlue.prototype.addView = function(viewRef)
  1774. {
  1775.    return this.dataProvider.addView(viewRef);
  1776. };
  1777. _global.DataGlue.prototype.getLength = function()
  1778. {
  1779.    return this.dataProvider.length;
  1780. };
  1781. _global.DataGlue.prototype.format = function(formatString, record)
  1782. {
  1783.    var _loc2_ = formatString.split("#");
  1784.    var _loc3_ = "";
  1785.    var tlen = _loc2_.length;
  1786.    var _loc1_ = 0;
  1787.    while(_loc1_ < tlen)
  1788.    {
  1789.       _loc3_ += _loc2_[_loc1_];
  1790.       _loc3_ += _loc2_[_loc1_ + 1] != "" ? record[_loc2_[_loc1_ + 1]] : "#";
  1791.       _loc1_ += 2;
  1792.    }
  1793.    return _loc3_;
  1794. };
  1795. _global.DataGlue.getItemAt_FormatString = function(index)
  1796. {
  1797.    var _loc2_ = this;
  1798.    var _loc1_ = _loc2_.dataProvider.getItemAt(index);
  1799.    if(_loc1_ == "in progress" || _loc1_ == undefined)
  1800.    {
  1801.       return _loc1_;
  1802.    }
  1803.    return {label:_loc2_.format(_loc2_.labelString,_loc1_),data:(_loc2_.dataString != null ? _loc2_.format(_loc2_.dataString,_loc1_) : _loc1_)};
  1804. };
  1805. _global.DataGlue.getItemAt_FormatFunction = function(index)
  1806. {
  1807.    var _loc1_ = this.dataProvider.getItemAt(index);
  1808.    if(_loc1_ == "in progress" || _loc1_ == undefined)
  1809.    {
  1810.       return _loc1_;
  1811.    }
  1812.    return this.formatFunction(_loc1_);
  1813. };
  1814. _global.DataGlue.prototype.getItemID = function(index)
  1815. {
  1816.    return this.dataProvider.getItemID(index);
  1817. };
  1818. _global.DataGlue.prototype.addItemAt = function(index, value)
  1819. {
  1820.    return this.dataProvider.addItemAt(index,value);
  1821. };
  1822. _global.DataGlue.prototype.addItem = function(value)
  1823. {
  1824.    return this.dataProvider.addItem(value);
  1825. };
  1826. _global.DataGlue.prototype.removeItemAt = function(index)
  1827. {
  1828.    return this.dataProvider.removeItemAt(index);
  1829. };
  1830. _global.DataGlue.prototype.removeAll = function()
  1831. {
  1832.    return this.dataProvider.removeAll();
  1833. };
  1834. _global.DataGlue.prototype.replaceItemAt = function(index, itemObj)
  1835. {
  1836.    return this.dataProvider.replaceItemAt(index,itemObj);
  1837. };
  1838. _global.DataGlue.prototype.sortItemsBy = function(fieldName, order)
  1839. {
  1840.    return this.dataProvider.sortItemsBy(fieldName,order);
  1841. };
  1842. _global.DataGlue.prototype.sortItems = function(compareFunc, order)
  1843. {
  1844.    return this.dataProvider.sortItems(compareFunc,order);
  1845. };
  1846. isGatewayOpen = null;
  1847. if(isGatewayOpen == null)
  1848. {
  1849.    isGatewayOpen = true;
  1850.    NetServices.setDefaultGatewayUrl("http://www.egamingzone.com/flashservices/gateway");
  1851.    gatewayConnection = NetServices.createGatewayConnection();
  1852.    inserthscfc = gatewayConnection.getService("cfc.inserths",this);
  1853. }
  1854.