
function ExpanderObserver() {

  this.selection = -1;

  this.onChangeSel = function(control, id) {
    if(this.selection == id) {
      if(control.isOpen(id)) {
        control.close(id);
      } else {
        control.open(id);
      }
    } else {
      if(this.selection >= 0) {
        control.close(this.selection);
      }
      control.open(id);
      this.selection = id;
    }
  }  
}

