From 8af3a30fa4df1a8803e9f4b58b8b92df9c850f34 Mon Sep 17 00:00:00 2001
From: Simon Kornblith <simon@simonster.com>
Date: Fri, 11 Feb 2011 18:04:31 +0000
Subject: [PATCH] fix tab switch issues

---
 chrome/content/zotero/tab.js | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/tab.js b/chrome/content/zotero/tab.js
index 786d6eaeca..ab655332b1 100644
--- a/chrome/content/zotero/tab.js
+++ b/chrome/content/zotero/tab.js
@@ -81,10 +81,6 @@ var ZoteroTab = new function()
 			var listener = function(event) {
 				if(event.target !== tab) return;
 				window.gBrowser.tabContainer.removeEventListener("TabSelect", listener, false);
-				if(!Zotero || !Zotero.initialized) {
-					ZoteroPane.displayStartupError(true);
-					return;
-				}
 				ZoteroPane.init();
 				ZoteroPane.makeVisible();
 			}
@@ -106,10 +102,10 @@ var ZoteroTab = new function()
 	}
 	
 	this.onUnload = function() {
-		if(window.ZoteroPane === window.ZoteroPane_Tab) {
-			window.ZoteroPane = window.ZoteroPane_Overlay;
+		if(this.containerWindow.ZoteroPane === this.containerWindow.ZoteroPane_Tab) {
+			this.containerWindow.ZoteroPane = this.containerWindow.ZoteroPane_Overlay;
 		}
-		delete window.ZoteroPane_Tab;
+		delete this.containerWindow.ZoteroPane_Tab;
 		ZoteroPane.destroy();
 	}
 }