
if ( !seatabx2Ns ) var seatabx2Ns = {};

Components.utils.import("resource://gre/modules/Services.jsm");

seatabx2Ns.myPrefObserver = { 

  register: function() {  
      window.removeEventListener('load', function(e) { 
          window.setTimeout(function() { seatabx2Ns.startDoers.startUpDoers(); }, 23); }, false); 
      Services.prefs.addObserver("browser.tabs.", this, false);
  }, 
  
  unregister: function() {  
      Services.prefs.removeObserver("browser.tabs.", this, false);
      window.removeEventListener('unload', function(e) { seatabx2Ns.myPrefObserver.unregister(); }, false);
  },
    
  observe: function(aSubject, aTopic, aData) {  
    if(aTopic != "nsPref:changed") return;  
    // aSubject is the nsIPrefBranch we're observing (after appropriate QI)  
    // aData is the name of the pref that's been changed (relative to aSubject)  
    switch (aData) {  
      case "browser.tabs.closeButtons":
        seatabx2Ns.prefDoers.browserTabsClosebuttons();
       break; 
    }  
  },

}  //close object


seatabx2Ns.startDoers = {   

  startUpDoers: function()
  {
      seatabx2Ns.myPrefObserver.register();
      seatabx2Ns.prefDoers.browserTabsClosebuttons();
  },
  
}  //close object


seatabx2Ns.prefDoers = {   

  browserTabsClosebuttons: function()
  {
    document.getElementById("content").setAttribute("browsertabsclosebuttons", 
      Services.prefs.getIntPref('browser.tabs.closeButtons')); 
  },

}   //close object


                              