home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / messenger.jar / content / messenger / addressbook / abAddressBookNameDialog.js next >
Text File  |  2005-07-29  |  1KB  |  51 lines

  1. var okCallback = 0;
  2. var gCanRename = true;
  3.  
  4. function abNameOnLoad()
  5. {
  6.   var abName = "";
  7.   
  8.     doSetOKCancel(abNameOKButton, 0);
  9.  
  10.     // look in arguments[0] for parameters
  11.     if ("arguments" in window && window.arguments[0])
  12.     {
  13.         if ("title" in window.arguments[0])
  14.         {
  15.             var title = window.arguments[0].title;
  16.             top.window.title = title;
  17.         }
  18.         
  19.         if ("okCallback" in window.arguments[0])
  20.             top.okCallback = window.arguments[0].okCallback;
  21.  
  22.     if ("name" in window.arguments[0])
  23.       abName = window.arguments[0].name;
  24.  
  25.     if ("canRename" in window.arguments[0])
  26.       gCanRename = window.arguments[0].canRename;
  27.     }
  28.     
  29.     // focus on input
  30.     var name = document.getElementById('name');
  31.   if (name) {
  32.     if (abName)
  33.       name.value = abName;
  34.     
  35.     if (gCanRename)
  36.       name.focus();
  37.     else
  38.       name.disabled = true;
  39.   }
  40.  
  41.     moveToAlertPosition();
  42. }
  43.  
  44. function abNameOKButton()
  45. {
  46.     if (top.okCallback && gCanRename)
  47.     top.okCallback(document.getElementById('name').value);
  48.     
  49.     return true;
  50. }
  51.