rem: var accountExists = false; var accountManager = Components.classes["component: try { var server = accountManager.FindServer(userName,hostName,serverType); if (server) { accountExists = true; } } catch (ex) { accountExists = false; } if (accountExists) { var alertText = Bundle.GetStringFromName("accountExists"); window.alert(alertText); return false; 
add: if (parent.AccountExists(userName,hostName,serverType)) { var alertText = Bundle.GetStringFromName("accountExists"); window.alert(alertText); return false; } 
context: function validate() {  var servername = document.getElementById("hostname");  var smtpserver = document.getElementById("smtphostname");  if ((servername && servername.value =="") ||      (smtpserver && smtpserver.value == "")) {    var alertText = Bundle.GetStringFromName("enterValidHostname");    window.alert(alertText);    return false;  }  dump("check if this account exists\n");  var pageData = parent.GetPageData();  var hostName = servername.value;  var serverType = parent.getCurrentServerType(pageData);  var userName = parent.getCurrentUserName(pageData);  var accountExists = false;  var accountManager = Components.classes["component://netscape/messenger/account-manager"].getService(Components.interfaces.nsIMsgAccountManager);  try {	var server = accountManager.FindServer(userName,hostName,serverType);	if (server) {		accountExists = true;	}  }  catch (ex) {	accountExists = false;  }  if (accountExists) {    var alertText = Bundle.GetStringFromName("accountExists");    window.alert(alertText);    return false;  }  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/2a911d6076070601166d73b916d26663a7dc86be/aw-server.js/buggy/mailnews/base/prefs/resources/content/aw-server.js