rem: var previouslyDisplayedPort = document.getElementById("server.port").value; 
add: var port = document.getElementById("server.port"); var portDefault = document.getElementById("defaultPort"); var prevDefaultPort = portDefault.value; 
context: function secureSelect() {    var serverType   = document.getElementById("server.type").getAttribute("value");    var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + serverType].getService(Components.interfaces.nsIMsgProtocolInfo);    var isSecureSelected = document.getElementById("server.isSecure").checked;    var defaultPort = protocolInfo.getDefaultServerPort(false);    var defaultPortSecure = protocolInfo.getDefaultServerPort(true);    var previouslyDisplayedPort = document.getElementById("server.port").value;    if (isSecureSelected) {      document.getElementById("defaultPort").value = defaultPortSecure;      if (previouslyDisplayedPort == defaultPort)        document.getElementById("server.port").value = defaultPortSecure;    }    else {      document.getElementById("defaultPort").value = defaultPort;      if (previouslyDisplayedPort == defaultPortSecure)        document.getElementById("server.port").value = defaultPort;    } }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3f5b2596af6247e9d80a4ad68f4327c1cebf83f6/am-server.js/buggy/mailnews/base/prefs/resources/content/am-server.js