manages = {
  tinterfaceURL: 'manage-interface.aspx',
  tAddLnk: function()
  {
    var tstrURL = manages.tinterfaceURL;
    tstrURL = tstrURL + '?type=addlnk';
    cls.tigets(tstrURL, manages.tAddLnks);
  },
  tAddLnks: function(_strers)
  {
    var tstrers = _strers;
    if (manage.tckBackString(tstrers))
    {
      tstrers = manage.tckrBackString(tstrers);
      popup.tShow(tstrers);
    };
  },
  tLnkAdd: function(_formobj)
  {
    var tformObj = _formobj;
    if (tformObj)
    {
      var tformBeObj = $I(tformObj.id + 'BeforeAction');
      if (tformBeObj) eval(tformBeObj.value);
      if (manage.validator.tCheck(tformObj))
      {
        var tAction = tformObj.action;
        var tstrform = cls.form.tgetValues(tformObj);
        var tAjaxSubmitObj = $I('popupAjaxSubmit');
        var tPopupMessageObj = $I('popupMessage');
        if (tAjaxSubmitObj) tAjaxSubmitObj.disabled = true;
        if (tPopupMessageObj) tPopupMessageObj.className = 'hidden';
        var tLoadingTimeout = setTimeout('manage.tSetClassName(\'popupLoading\', \'ash\')', 200);
        cls.tiposts(tAction, tstrform, manages.tLnkAdds, tLoadingTimeout);
      };
    };
    return false;
  },
  tLnkAdds: function(_strers, _timeout)
  {
    var tstrers = _strers;
    var tLoadingTimeout = _timeout;
    clearTimeout(tLoadingTimeout);
    var tLoadingObj = $I('popupLoading');
    var tAjaxSubmitObj = $I('popupAjaxSubmit');
    if (tLoadingObj) tLoadingObj.className = 'hidden';
    if (tAjaxSubmitObj) tAjaxSubmitObj.disabled = false;
    if (manage.tckBackString(tstrers))
    {
      tstrers = manage.tckrBackString(tstrers);
      if (tstrers.indexOf('<!--200-->') != -1) location.reload();
      else
      {
        var tPopupTopic = $I('popupTopic');
        var tLoginMessageObj = $I('popupMessage');
        var tLoginMessageTextObj = $I('popupMessageText');
        if (tPopupTopic) tPopupTopic.focus();
        if (tLoginMessageObj) tLoginMessageObj.className = null;
        if (tLoginMessageTextObj) tLoginMessageTextObj.innerHTML = tstrers;
      };
    };
  },
  tLnkDelete: function(_strid)
  {
    var tstrid = _strid;
    var tPopupConfirmOkObj = $I('popupConfirmOk');
    if (tPopupConfirmOkObj) tPopupConfirmOkObj.disabled = true;
    cls.tigets(manages.tinterfaceURL + '?type=action&atype=deletelnk&id=' + tstrid, manages.tLnkDeletes, tstrid);
  },
  tLnkDeletes: function(_strers, _strid)
  {
    popup.tClose();
    var tstrid = _strid;
    var tstrers = _strers;
    if (tstrers == '200')
    {
      var tMyLnkObj = $I('userLnkMode1Tr' + tstrid);
      if (tMyLnkObj) tMyLnkObj.parentNode.removeChild(tMyLnkObj);
    };
  },
  tLoadMyUserLnkList: function()
  {
    var tstrURL = manages.tinterfaceURL;
    tstrURL = tstrURL + '?type=loadlnk';
    cls.tigets(tstrURL, manages.tLoadMyUserLnkLists);
  },
  tLoadMyUserLnkLists: function(_strers)
  {
    var tstrers = _strers;
    if (manage.tckBackString(tstrers))
    {
      tstrers = manage.tckrBackString(tstrers);
      var tUserLnkListObj = $I('userLnkList');
      var tUserLnkMode0ListObj = $I('userLnkMode0List');
      if (tUserLnkListObj) tUserLnkListObj.innerHTML = tstrers;
      if (tUserLnkMode0ListObj)
      {
        if (tstrers.indexOf('<nobr>') != -1) tUserLnkMode0ListObj.style.display = 'inline';
      };
    };
  },
  tSaveUserLnkOrder: function(_stridary)
  {
    var tstridary = _stridary;
    cls.tigets(manages.tinterfaceURL + '?type=action&atype=orderlnk&idary=' + tstridary, nll);
  },
  tSwitchLnkMode: function(_mode)
  {
    var tMode = _mode;
    var tMode0Obj = $I('userLnkMode0');
    var tMode1Obj = $I('userLnkMode1');
    if (tMode0Obj) tMode0Obj.style.display = 'none';
    if (tMode1Obj) tMode1Obj.style.display = 'none';
    if (tMode == 0)
    {
      manages.tLoadMyUserLnkList();
      tMode0Obj.style.display = 'block';
    }
    else if (tMode == 1) tMode1Obj.style.display = 'block';
  }
};
