rem: if (elements.length == 0) 
add: if (!elements.item(0)) 
context: function initSmtpSettings(server) {    gSmtpUsername = document.getElementById("smtp.username");    gSmtpUsernameLabel = document.getElementById("smtpusernamelabel");    gSmtpHostname = document.getElementById("smtp.hostname");    gSmtpPort = document.getElementById("smtp.port");    gSmtpUseUsername = document.getElementById("smtp.useUsername");    gSmtpAuthMethod = document.getElementById("smtp.authMethod");    gSmtpTrySSL = document.getElementById("smtp.trySSL");    gDefaultPort = document.getElementById("smtp.defaultPort");    gPort = document.getElementById("smtp.port");    gSmtpS = document.getElementById("smtp.alwaysSmtpS");    if (server) {        gSmtpHostname.value = server.hostname;        gSmtpPort.value = server.port ? server.port : "";        gSmtpUsername.value = server.username;        gSmtpAuthMethod.setAttribute("value", server.authMethod);        var elements = gSmtpTrySSL.getElementsByAttribute("value", server.trySSL);        if (elements.length == 0)            elements = gSmtpTrySSL.getElementsByAttribute("value", "1");        gSmtpTrySSL.selectedItem = elements[0];    } else {        gSmtpAuthMethod.setAttribute("value", "1");        gSmtpTrySSL.selectedItem =            gSmtpTrySSL.getElementsByAttribute("value", "1")[0];    }    gSmtpUseUsername.checked = (gSmtpAuthMethod.getAttribute("value") == "1");    //dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n");    //dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n");    onUseUsername(gSmtpUseUsername, false);    updateControls();    selectProtocol(1);    if (gSmtpService.defaultServer)      onLockPreference();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/846feff6655c64b6730d27fc562b2473668519f4/smtpEditOverlay.js/buggy/mailnews/base/prefs/resources/content/smtpEditOverlay.js