rem: var override = document.getElementById("identity.overrideGlobalPref"); var autocomplete = document.getElementById("ldapAutocomplete"); var directoryServer = document.getElementById("identity.directoryServer"); var directoriesList = document.getElementById("directoriesList").getAttribute('value');          switch(autocomplete.value) { case "0": override.setAttribute('value', ""); document.getElementById("overrideGlobalPref").setAttribute("value", "0"); document.getElementById("directoryServer").setAttribute("value", ""); break; case "1": override.setAttribute('value', true); directoryServer.setAttribute("value", directoriesList); document.getElementById("overrideGlobalPref").setAttribute("value", ""); if(directoriesList == "") document.getElementById("directoryServer").setAttribute("value", "none"); else document.getElementById("directoryServer").setAttribute("value", ""); break; } 
add: onSaveCompositionAndAddressing(); 
context: function onSave(){  var override = document.getElementById("identity.overrideGlobalPref");  var autocomplete = document.getElementById("ldapAutocomplete");  var directoryServer = document.getElementById("identity.directoryServer");  var directoriesList =       document.getElementById("directoriesList").getAttribute('value');    // When switching between panes,   // if we save the value of an element as null  // we will be forced to get the value from preferences when we get back.  // We are saving the value as "" for the radio button and also for  // the directory server if the selected directory is "None"  // So, we need the two elements overrideGlobalPref and directoryServer  // to save the state when the directory is   // set to none and the first radio button is selected.  switch(autocomplete.value)  {    case "0":      override.setAttribute('value', "");      document.getElementById("overrideGlobalPref").setAttribute("value", "0");      document.getElementById("directoryServer").setAttribute("value", "");      break;    case "1":      override.setAttribute('value', true);      directoryServer.setAttribute("value", directoriesList);      document.getElementById("overrideGlobalPref").setAttribute("value", "");      if(directoriesList == "")        document.getElementById("directoryServer").setAttribute("value", "none");      else        document.getElementById("directoryServer").setAttribute("value", "");      break;  } }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/5771f31ec158684707569c976e5a8d78ce9737f1/am-addressing.js/buggy/mailnews/base/prefs/resources/content/am-addressing.js