home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / aim.jar / content / aim / AimStoreEmail.js < prev    next >
Encoding:
Text File  |  2005-07-29  |  1.1 KB  |  43 lines

  1. var gscreenName;
  2. var gcurEmail=null;
  3.  
  4.  
  5. function storeEmailOnLoad()
  6. {
  7.   doSetOKCancel(onOKStoreEmail, onCancel);
  8.   gscreenName = window.arguments[0];
  9.  
  10.   document.getElementById("screenname").setAttribute("value",gscreenName);
  11.   gcurEmail = aimFeedbagManager().GetEmailId(gscreenName);
  12.   if (gcurEmail && gcurEmail != "")
  13.     document.getElementById("fldnewEmail").setAttribute("value",gcurEmail);
  14.   document.getElementById("fldnewEmail").focus();
  15. }
  16.  
  17. function eaKeyPress(event)
  18. {
  19.   if (event.keyCode == 13) {
  20.     //enter key is pressed. ok the window. onOK will take care of validations
  21.     onOKStoreEmail();
  22.   }
  23. }
  24.  
  25. function onOKStoreEmail()
  26. {
  27.   var newemail = document.getElementById("fldnewEmail").value;
  28.   if (!validateEmailAddress(newemail)) {
  29.     aimErrorBox(aimString("msg.enterValidEmail"));
  30.     return;
  31.   }
  32.   aimFeedbagManager().SetEmailId(gscreenName, newemail);
  33.   aimBuddyManager().SetUserEmailStateinDS(gscreenName, Components.interfaces.nsAimBuddyEmailStates.HasEmail);
  34.   window.close();
  35. }
  36.  
  37. function onCancel()
  38. {
  39.   window.close();
  40. }
  41.  
  42.  
  43.