add:  var children = listbox.childNodes; for (var i = children.length; i > 0; i--) { listbox.removeChild(children[i-1]); }  
context: function CCKReadConfigFile(srcdir){  var file = srcdir.clone();  file.append("cck.config");    if (!file.exists()) {    DoEnabling();    toggleProxySettings();    return;  }  var stream = Components.classes["@mozilla.org/network/file-input-stream;1"]                         .createInstance(Components.interfaces.nsIFileInputStream);  stream.init(file, 0x01, 0644, 0);  var lis = stream.QueryInterface(Components.interfaces.nsILineInputStream);  var line = {value:null};    var prefList = document.getElementById('prefList');      configarray = new Array();  do {    var more = lis.readLine(line);    var str = line.value;    var equals = str.indexOf('=');    if (equals != -1) {      firstpart = str.substring(0,equals);      secondpart = str.substring(equals+1);      configarray[firstpart] = secondpart;      try {        (document.getElementById(firstpart).value = secondpart)      } catch (ex) {}    }  } while (more);    // handle prefs  listbox = document.getElementById('prefList');  var i = 1;  while( prefname = configarray['PreferenceName' + i]) {    listbox.appendItem(prefname, configarray['PreferenceValue' + i]);    i++;  }      // handle registry items  listbox = document.getElementById('regList');  var i = 1;  while( regname = configarray['RegName' + i]) {    var listitem = listbox.appendItem(regname, "");    listitem.rootkey = configarray['RootKey' + i];    listitem.key = configarray['Key' + i];    listitem.name = configarray['Name' + i];    listitem.namevalue = configarray['NameValue' + i];    listitem.type = configarray['Type' + i];    i++;  }    var sourcefile = Components.classes["@mozilla.org/file/local;1"]                       .createInstance(Components.interfaces.nsILocalFile);  // handle searchplugins  listbox = document.getElementById('searchPluginList');  var i = 1;  while(searchpluginname = configarray['SearchPlugin' + i]) {    item = document.createElement("richlistitem");    image = document.createElement("image");    label = document.createElement("label");    image.value = configarray['SearchPluginIcon' + i];    label.setAttribute("value", searchpluginname);      try {    sourcefile.initWithPath(configarray['SearchPluginIcon' + i]);    var ioServ = Components.classes["@mozilla.org/network/io-service;1"]                           .getService(Components.interfaces.nsIIOService);    var foo = ioServ.newFileURI(sourcefile);    image.setAttribute("src", foo.spec);  } catch (e) {    image.setAttribute("src", "");  }    item.appendChild(image);    item.appendChild(label);      listbox.appendChild(item);    i++;  }    DoEnabling();  toggleProxySettings();    stream.close();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e9a51a32bc6f9b73a6ef72ef8ec7e8b46437de4c/cckwizard.js/clean/extensions/cck/browser/resources/content/cckwizard/cckwizard.js