rem: var sidebar_element = document.getElementById('sidebarbox') 
add: var sidebar_element = document.getElementById('sidebar-box') 
context: function sidebarOverlayInit(usersidebar){  // load up user-specified sidebar  if (usersidebar) {    //dump("usersidebar = " + usersidebar + "\n")    //dump("usersidebar.resource = " + usersidebar.resource + "\n")    //dump("usersidebar.db = " + usersidebar.db + "\n")    sidebar = usersidebar  }   else {                      try     {      var profileInterface = Components.interfaces.nsIProfile      var profileURI = 'component://netscape/profile/manager'      var profileService  = Components.classes[profileURI].getService()      profileService = profileService.QueryInterface(profileInterface)      var sidebar_url = profileService.getCurrentProfileDirFromJS()      sidebar_url.URLString += "sidebar.rdf"      if (!(sidebar_url.exists())) {        //dump("using " + defaultsidebar.db + " because " +         //sidebar_url.URLString + " does not exist\n")      } else {        //dump("sidebar url is " + sidebar_url.URLString + "\n")        defaultsidebar.db = sidebar_url.URLString      }    }    catch (ex)     {      //dump("failed to get sidebar url, using default\n")    }    sidebar = defaultsidebar  }  var sidebar_element = document.getElementById('sidebarbox')  if (sidebar_element.getAttribute('hidden') == 'true') {    sidebar_element.setAttribute('style', 'display:none')    return  }  //dump("sidebar = " + sidebar + "\n")  //dump("sidebar.resource = " + sidebar.resource + "\n")  //dump("sidebar.db = " + sidebar.db + "\n")  var registry  try {    // First try to construct a new one and load it    // synchronously. nsIRDFService::GetDataSource() loads RDF/XML    // asynchronously by default.    var xmlsrc = 'component://netscape/rdf/datasource?name=xml-datasource'    registry = Components.classes[xmlsrc].createInstance()    registry = registry.QueryInterface(Components.interfaces.nsIRDFDataSource)    var remote = Components.interfaces.nsIRDFRemoteDataSource    remote = registry.QueryInterface(remote)    // this will throw if it's already been opened and registered.    remote.Init(sidebar.db)    // read it in synchronously.    remote.Refresh(true)  }  catch (ex) {    // if we get here, then the RDF/XML has been opened and read    // once. We just need to grab the datasource.    registry = RDF.GetDataSource(sidebar.db)  }  // Create a 'container' wrapper around the sidebar.resources  // resource so we can use some utility routines that make access a  // bit easier.  var sb_datasource = Components.classes['component://netscape/rdf/container']  var container    = Components.interfaces.nsIRDFContainer  try {    sb_datasource     = sb_datasource.createInstance()    sb_datasource     = sb_datasource.QueryInterface(container)    sb_datasource.Init(registry, RDF.GetResource(sidebar.resource))  }  catch (ex) {  //dump("failed to init sb_datasource\n")  }    var mypanelsbox = document.getElementById('sidebarpanels')  // Now enumerate all of the flash datasources.  var enumerator = null  try {  enumerator = sb_datasource.GetElements()  }  catch (ex) {  //dump("sb_datasource has no elements.\n")  }  if (!enumerator) return  while (enumerator.HasMoreElements()) {    var service = enumerator.GetNext()    service = service.QueryInterface(Components.interfaces.nsIRDFResource)    var is_last = !enumerator.HasMoreElements()    var new_panel = sidebarAddPanel(mypanelsbox, registry, service, is_last)  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/a47bbecd09665e0d469bdeff949a3424fb3fb891/sidebarOverlay.js/clean/suite/common/sidebar/sidebarOverlay.js