rem: if (other_panels.selectedItems.length > 0) { add_button.setAttribute('disabled',''); preview_button.setAttribute('disabled',''); } else { add_button.setAttribute('disabled','true'); preview_button.setAttribute('disabled','true'); } 
add: var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var other_panels = document.getElementById('other-panels');  var num_selected = 0;  for (var ii=0; ii<other_panels.selectedItems.length; ii++) { var node = other_panels.selectedItems[ii]; if (node.getAttribute('container') != 'true') { num_selected++; } }  if (num_selected > 0) { add_button.setAttribute('disabled',''); preview_button.setAttribute('disabled',''); } else { add_button.setAttribute('disabled','true'); preview_button.setAttribute('disabled','true'); } 
context: function otherPanelSelected(){     var add_button = document.getElementById('add_button');    var preview_button = document.getElementById('preview_button');    var other_panels = document.getElementById('other-panels');    if (other_panels.selectedItems.length > 0) {        add_button.setAttribute('disabled','');        preview_button.setAttribute('disabled','');    }    else {        add_button.setAttribute('disabled','true');        preview_button.setAttribute('disabled','true');    }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1a32cc1c526c53fd9e341d35b5639757bb33402a/customize.js/buggy/xpfe/components/sidebar/resources/customize.js