private void savePreferences() {

		/* save general information */
		preference.put("Version", VERSION);

		/* save size and location */
		if (windowCount < 2) {
			preference.putInt("Upper Left X", getBounds().x);
			preference.putInt("Upper Left Y", getBounds().y);
			preference.putInt("Width", editor.getWidth());
			preference.putInt("Height", editor.getHeight());
		}

		Initializer.sharedInstance().putSystemProperty(PreferencesDialog.LAST_VISITED_PAGE, editor.getPage().getAddress());
		if (preferencesDialog != null) {

			// save home page settings, if the preferences dialog has ever been invoked.
			Initializer.sharedInstance().putSystemProperty(PreferencesDialog.HOME_PAGE, preferencesDialog.getHome());
			preference.put("Start From", preferencesDialog.getStartPageType());

			/* save proxy server settings */
			if (preferencesDialog.getUseProxy()) {
				String proxyAddress = preferencesDialog.getProxyAddress();
				if (proxyAddress != null && !proxyAddress.trim().equals("")) {
					preference.put("Proxy Address", proxyAddress);
				}
				else {
					preference.remove("Proxy Address");
				}
				int proxyPortNumber = preferencesDialog.getProxyPortNumber();
				if (proxyPortNumber >= 0) {
					preference.putInt("Proxy Port", proxyPortNumber);
				}
				else {
					preference.remove("Proxy Port");
				}
				String proxyUserName = preferencesDialog.getProxyUserName();
				if (proxyUserName != null && !proxyUserName.trim().equals("")) {
					preference.put("Proxy Username", proxyUserName);
				}
				else {
					preference.remove("Proxy Username");
				}
				char[] proxyPassword = preferencesDialog.getProxyPassword();
				if (proxyPassword != null && proxyPassword.length > 0) {
					preference.put("Proxy Password", new String(proxyPassword));
				}
				else {
					preference.remove("Proxy Password");
				}
			}
			else {
				preference.remove("Proxy Address");
				preference.remove("Proxy Port");
				preference.remove("Proxy Username");
				preference.remove("Proxy Password");
			}

		}

		/* save look&feel setting */
		if (lookandfeel != null && !disableSetLAF)
			preference.put("Look&Feel", lookandfeel);

		/* save tape length */
		preference.putInt("Tape Length", tapeLength);

		/* cache options */
		preference.putBoolean("Cache Enabled", ConnectionManager.sharedInstance().isCachingAllowed());
		preference.putInt("History", HistoryManager.sharedInstance().getDays());

		BookmarkManager.sharedInstance().writeBookmarks(new File(Initializer.sharedInstance().getPropertyDirectory(), "bookmarks.xml"));
		HistoryManager.sharedInstance().writeHistory(new File(Initializer.sharedInstance().getPropertyDirectory(), "history.xml"));
		ModelerUtilities.fileChooser.writeHistory(new File(Initializer.sharedInstance().getPropertyDirectory(), "filechooser.xml"));
		Initializer.sharedInstance().writeSystemProperties();

	}