manages = {
  ttempArg: null,
  tinterfaceURL: 'manage-interface.aspx',
  tinterfaceContentID: 'rightContent',
  tSaveOrderInitIdAry: '',
  tInit: function(_strArg)
  {
    var tstrArg = _strArg;
    manages.tLoad(tstrArg);
  },
  tLoad: function(_strArg)
  {
    var tstrArg = _strArg;
    manages.ttempArg = tstrArg;
    var tstrURL = manages.tinterfaceURL;
    if (tstrArg) tstrURL += tstrArg;
    manage.windows.tShowPanelLoading();
    cls.tigets(tstrURL, manages.tLoads);
    try { editor.tClear(); } catch(e) {};
  },
  tLoads: function(_strers)
  {
    var tstrers = _strers;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers))
    {
      if (tstrers.indexOf('<!--alert-->') != -1) manage.message.tAlert(tstrers);
      else
      {
        setInnerHTML($I(manages.tinterfaceContentID), tstrers);
        var tstrHighlightObj = $I(cls.tgetParameter(manages.ttempArg, 'highlight'));
        if (tstrHighlightObj)
        {
          tstrHighlightObj.className = 'spanHrefSelected';
          tstrHighlightObj.setAttribute('primaryClass', 'spanHrefSelected');
        };
      };
    };
  },
  tAdd: 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();
        cls.tiposts(tAction, tstrform, manages.tAdds);
      };
    };
    return false;
  },
  tAdds: function(_strers)
  {
    var tstrers = _strers;
    $I('ajaxSubmit').disabled = false;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers))
    {
      manage.message.tAlert(tstrers);
      if (tstrers.indexOf('<!--200-->') != -1) manages.tRefresh();
    };
  },
  tEdit: 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();
        cls.tiposts(tAction, tstrform, manages.tEdits);
      };
    };
    return false;
  },
  tEdits: function(_strers)
  {
    var tstrers = _strers;
    $I('ajaxSubmit').disabled = false;
    manage.windows.tHidePanelLoading();
    if (manage.tckBackString(tstrers))
    {
      manage.message.tAlert(tstrers);
      if (tstrers.indexOf('<!--200-->') != -1) manages.tRefresh();
    };
  },
  tDelete: function(_strid)
  {
    var tstrid = _strid;
    manage.windows.tShowPanelLoading();
    cls.tigets(manages.tinterfaceURL + '?type=action&atype=delete&id=' + tstrid, manages.tDeletes);
  },
  tDeletes: function(_strers)
  {
    var tstrers = _strers;
    manage.windows.tHidePanelLoading();
    if (tstrers == '200') manages.tRefresh();
  },
  tSaveOrder: function(_stridary)
  {
    var tstridary = _stridary;
    if (manages.tSaveOrderInitIdAry != tstridary)
    {
      manages.tSaveOrderInitIdAry = tstridary;
      cls.tigets(manages.tinterfaceURL + '?type=action&atype=order&idary=' + tstridary, nll);
    };
  },
  tSaveOrderInit: function(_stridary)
  {
    var tstridary = _stridary;
    manages.tSaveOrderInitIdAry = tstridary;
  },
  tSwitch: function(_strswtype, _strids)
  {
    var tswtype = _strswtype;
    var tstrids = _strids;
    manage.windows.tShowPanelLoading();
    cls.tigets(manages.tinterfaceURL + '?type=action&atype=switch&swtype=' + escape(tswtype) + '&ids=' + escape(tstrids), manages.tSwitchs);
  },
  tSwitchs: function(_strers)
  {
    var tstrers = _strers;
    manage.windows.tHidePanelLoading();
    if (tstrers == '200') manages.tRefresh();
  },
  tRefresh: function()
  {
    manages.tLoad(manages.ttempArg);
  }
};