public synchronized void endDocument() throws SAXException {
			// FIXME: Is this right? the following code seems to fix the missed notification problem in Mac OS X
			// when there is a mw3d container on the page with many atoms and bonds to load.
			try {
				Thread.sleep(100);
			}
			catch (InterruptedException ignored) {
			}
			synchronized (lock) {
				lock.notify();
			}
			if (referencedFiles != null)
				page.setAdditionalResourceFiles(referencedFiles);
			if (resourceLoadingThread == null) {
				resourceLoadingThread = new Thread("Resource Loader #" + threadIndex) {
					public void run() {
						while (true) {
							mw3dConnector.loadResources();
							mw2dConnector.loadResources();
							jmolConnector.loadResources();
							pluginConnector.start();
							EventQueue.invokeLater(new Runnable() {
								public void run() {
									if (progressBar != null)
										progressBar.setValue(progressBar.getMaximum());
									page.setTitle(pageTitle);
									radioButtonConnector.connect();
									htmlComponentConnector.connect();
									mw3dConnector.finishLoading();
									mw2dConnector.finishLoading();
									jmolConnector.finishLoading();
									pluginConnector.connect();
									page.autoResizeComponents();
									finish();
								}
							});
							synchronized (lock) {
								try {
									lock.wait();
								}
								catch (InterruptedException e) {
									// e.printStackTrace();
									break;
								}
							}
						}
					}
				};
				resourceLoadingThread.setPriority(Page.LOADER_THREAD_PRIORITY);
				resourceLoadingThread.setUncaughtExceptionHandler(new DisasterHandler(DisasterHandler.LOAD_ERROR,
						new Runnable() {
							public void run() {
								// nullify the thread to allow a new one to be constructed when loading next page
								resourceLoadingThread = null;
							}
						}, null, page));
				resourceLoadingThread.start();
			}
		}