manage_batchprocessings = {
  ttempArg: null,
  tinterfaceURL: 'manage_batchprocessing-interface.aspx',
  tinterfaceContentID: 'windowsContent-rightPanel-Content',
  tInit: function(_strArg)
  {
    var tstrArg = _strArg;
    var tnParameter = manage.tgetPoundURLParameter(self.location.href);
    if (tnParameter && tnParameter != 'null') tstrArg = tnParameter;
    var tnParaField = cls.tgetParameter(tstrArg, 'field');
    var tnParaKeyword = cls.tgetParameter(tstrArg, 'keyword');
    if (tnParaField) cls.tselOptions($I('field'), tnParaField);
    if (tnParaKeyword) $I('keyword').value = unescape(tnParaKeyword);
    manage_batchprocessings.tLoad(tstrArg);
  },
  tLoad: function(_strArg)
  {
    var tstrArg = _strArg;
    manage_batchprocessings.ttempArg = tstrArg;
    self.location.href = '#' + tstrArg;
    var tstrURL = manage_batchprocessings.tinterfaceURL;
    if (tstrArg) tstrURL += tstrArg;
    manage.windows.tShowPanelLoading();
    manage.tajaxGet(tstrURL, manage_batchprocessings.tLoads);
  },
  tLoads: function(_strers)
  {
    var tstrers = _strers;
    manage.tajaxCompleted();
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers))
    {
      if (tstrers.indexOf('<!--alert-->') != -1) manage.windows.dialog.tAlert(tstrers);
      else setInnerHTML($I(manage_batchprocessings.tinterfaceContentID), tstrers);
    };
  },
  tBatch1: function(_strfname)
  {
    var tstrfname = _strfname;
    var tformObj = $I(tstrfname);
    if (tformObj)
    {
      var tformBeObj = $I(tstrfname + 'BeforeAction');
      if (tformBeObj) eval(tformBeObj.value);
      if (manage.validator.tCheck(tformObj))
      {
        var tAction = tformObj.action;
        var tstrform = cls.form.tgetValues(tformObj);
        $I('ajaxSubmit').disabled = true;
        manage.windows.tShowPanelLoading();
        manage.tajaxPost(tAction, tstrform, manage_batchprocessings.tBatch1s);
      };
    };
  },
  tBatch1s: function(_strers)
  {
    var tstrers = _strers;
    manage.tajaxCompleted();
    $I('ajaxSubmit').disabled = false;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers)) manage.windows.dialog.tAlert(tstrers);
  },
  tBatch2: function(_strfname)
  {
    var tstrfname = _strfname;
    var tformObj = $I(tstrfname);
    if (tformObj)
    {
      var tformBeObj = $I(tstrfname + 'BeforeAction');
      if (tformBeObj) eval(tformBeObj.value);
      if (manage.validator.tCheck(tformObj))
      {
        var tAction = tformObj.action;
        var tstrform = cls.form.tgetValues(tformObj);
        $I('ajaxSubmit').disabled = true;
        manage.windows.tShowPanelLoading();
        manage.tajaxPost(tAction, tstrform, manage_batchprocessings.tBatch2s);
      };
    };
  },
  tBatch2s: function(_strers)
  {
    var tstrers = _strers;
    manage.tajaxCompleted();
    $I('ajaxSubmit').disabled = false;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers)) manage.windows.dialog.tAlert(tstrers);
  },
  tBatch3: function(_strfname)
  {
    var tstrfname = _strfname;
    var tformObj = $I(tstrfname);
    if (tformObj)
    {
      var tformBeObj = $I(tstrfname + 'BeforeAction');
      if (tformBeObj) eval(tformBeObj.value);
      if (manage.validator.tCheck(tformObj))
      {
        var tAction = tformObj.action;
        var tstrform = cls.form.tgetValues(tformObj);
        $I('ajaxSubmit').disabled = true;
        manage.windows.tShowPanelLoading();
        manage.tajaxPost(tAction, tstrform, manage_batchprocessings.tBatch3s);
      };
    };
  },
  tBatch3s: function(_strers)
  {
    var tstrers = _strers;
    manage.tajaxCompleted();
    $I('ajaxSubmit').disabled = false;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers)) manage.windows.dialog.tAlert(tstrers);
  },
  tRefresh: function()
  {
    manage_batchprocessings.tLoad(manage_batchprocessings.ttempArg);
  },
  tSelslng: function(_strArg)
  {
    var tstrArg = _strArg;
    var tstrURL = manage_batchprocessings.tinterfaceURL + '?type=action&atype=selslng&lng=';
    if (tstrArg)
    {
      tstrURL += tstrArg;
      var tobj = $I('selslng');
      manage.tajaxGet(tstrURL, manage_batchprocessings.tSelslngs);
    }
    else manage.tajaxLoad(tstrURL, 'selslng');
  },
  tSelslngs: function(_strers)
  {
    var tstrers = _strers;
    manage.tajaxCompleted();
    if (tstrers == "200")
    {
      manage_batchprocessings.tSelslng();
      manage_batchprocessings.tLoad(manage_batchprocessings.ttempArg);
    };
  }
};
