home *** CD-ROM | disk | FTP | other *** search
/ Chip 2009 November / Chip_2009.11_CD.iso / I386 / nusrmgr.cp_ / nusrmgr.cpl / HTML / ACCT_COMMON.JS < prev    next >
Encoding:
Text File  |  2008-04-14  |  1.5 KB  |  74 lines

  1. var _iPrevious = -1;
  2. var _iCurrent = 0;
  3. function _ShowDescription(iNew)
  4. {
  5. if (iNew >= 0 && iNew <= idDesc.length)
  6. {
  7. if (_iCurrent != iNew)
  8. idDesc[_iCurrent].style.display = 'none';
  9. _iCurrent = iNew;
  10. idDesc[_iCurrent].style.display = 'block';
  11. }
  12. }
  13. function _OnClick()
  14. {
  15. var iNewType = this.parentElement.cellIndex;
  16. top.window.g_iNewType = iNewType;
  17. _ShowDescription(iNewType);
  18. idOK.disabled = (_iPrevious == iNewType);
  19. }
  20. function _OnFocus()
  21. {
  22. _ShowDescription(this.parentElement.cellIndex);
  23. }
  24. function _OnMouseOver()
  25. {
  26. if (!this.contains(event.fromElement))
  27. _ShowDescription(this.cellIndex);
  28. }
  29. function _OnMouseOut()
  30. {
  31. if (!this.contains(event.toElement))
  32. _ShowDescription(top.window.g_iNewType);
  33. }
  34. function AttachAccountTypeEvents(iPreviousType)
  35. {
  36. if (null != iPreviousType)
  37. _iPrevious = iPreviousType;
  38. var aTypes = idRadioGroup.children;
  39. if (aTypes)
  40. {
  41. var cTypes = aTypes.length;
  42. for (var i = 0; i < cTypes; i++)
  43. {
  44. aTypes[i].onmouseover = _OnMouseOver;
  45. aTypes[i].onmouseout = _OnMouseOut;
  46. aTypes[i].firstChild.onclick = _OnClick;
  47. aTypes[i].firstChild.onfocus = _OnFocus;
  48. }
  49. }
  50. }
  51. function SetAccountType(oUser)
  52. {
  53. var nErr = 0;
  54. try
  55. {
  56. var iNewType = top.window.g_iNewType;
  57. if (_iPrevious != iNewType)
  58. oUser.setting("AccountType") = (0 == iNewType) ? 3 : 1;
  59. }
  60. catch (error)
  61. {
  62. nErr = (error.number & 0xffff);
  63. if (2220 == nErr) 
  64. {
  65. alert(top.window.L_GroupNotExist_ErrorMessage);
  66. }
  67. else
  68. {
  69. throw error;
  70. }
  71. }
  72. top.window.g_iNewType = null;
  73. }
  74.