home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mozil06.zip / bin / chrome / messenger.jar / content / messenger / aw-accounttype.js < prev    next >
Text File  |  2001-02-14  |  2KB  |  65 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public
  4.  * License Version 1.1 (the "License"); you may not use this file
  5.  * except in compliance with the License. You may obtain a copy of
  6.  * the License at http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the License is distributed on an "AS
  9.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10.  * implied. See the License for the specific language governing
  11.  * rights and limitations under the License.
  12.  *
  13.  * The Original Code is mozilla.org code.
  14.  *
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corporation.  Portions created by Netscape are
  17.  * Copyright (C) 1998 Netscape Communications Corporation. All
  18.  * Rights Reserved.
  19.  *
  20.  * Contributor(s):
  21.  * Alec Flett <alecf@netscape.com>
  22.  */
  23.  
  24. function onInit() {
  25.     // this is a total hack.
  26.     // select the first radio button, assuming the wizard hasn't
  27.     // already selected one for us. The wizard can get in this wierd state
  28.     var elements = document.getElementsByAttribute("group", "acctyperadio");
  29.     var topItem = elements[0];
  30.     for (var i=0; i < elements.length; i++)
  31.         if (elements[i].checked) topItem = elements[i];
  32.  
  33.     document.getElementById("acctyperadio").selectedItem = topItem;
  34. }
  35.  
  36. function onUnload() {
  37.     dump("OnUnload!\n");
  38.     parent.UpdateWizardMap();
  39.  
  40.     initializeIspData();
  41.     
  42.     return true;
  43. }
  44.  
  45.  
  46. function initializeIspData()
  47. {
  48.     if (!document.getElementById("mailaccount").checked) {
  49.         parent.SetCurrentAccountData(null);
  50.     }
  51.     
  52.     // now reflect the datasource up into the parent
  53.     var accountSelection = document.getElementById("acctyperadio");
  54.  
  55.     var ispName = accountSelection.selectedItem.id;
  56.  
  57.     dump("initializing ISP data for " + ispName + "\n");
  58.     
  59.     if (!ispName || ispName == "") return;
  60.  
  61.     parent.PrefillAccountForIsp(ispName);
  62.     parent.UpdateWizardMap();
  63. }
  64.  
  65.