rem: var selected = profileList.selectedItems[0]; 
add: var selected = profileList.view.getItemAtIndex(profileList.currentIndex); 
context: function DoEnabling(){  var renbutton = document.getElementById( "renbutton" );  var delbutton = document.getElementById( "delbutton" );  var start     = document.getElementById( "ok" );    var profileList = document.getElementById( "profiles" );  var items = profileList.selectedItems;  if( items.length != 1 )  {    renbutton.setAttribute( "disabled", "true" );    delbutton.setAttribute( "disabled", "true" );    start.setAttribute( "disabled", "true" );  }  else {    if( renbutton.getAttribute( "disabled" ) == "true" )      renbutton.removeAttribute( "disabled", "true" );    if( start.getAttribute( "disabled" ) == "true" )      start.removeAttribute( "disabled", "true" );        var canDelete = true;    if (!gStartupMode) {        var selected = profileList.selectedItems[0];      var profileName = selected.getAttribute("profile_name");      var currentProfile = profile.currentProfile;      if (currentProfile && (profileName == currentProfile))        canDelete = false;          }    if (canDelete) {      if ( delbutton.getAttribute( "disabled" ) == "true" )        delbutton.removeAttribute( "disabled" );    }    else      delbutton.setAttribute( "disabled", "true" );        }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/97b2b7af1273ff0f6a722d514056886f4d4e2d5a/profileManager.js/buggy/profile/resources/content/profileManager.js