Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 2715)
@@ -50,5 +50,5 @@
 import org.openstreetmap.josm.gui.SplashScreen;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
-import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
+import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.io.SaveLayersDialog;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -392,14 +392,4 @@
             }
         }
-    }
-
-    /**
-     * Run any cleanup operation before exit
-     *
-     */
-    public static  void cleanupBeforeExit() {
-        // try to close and exit the help browser running in another process
-        //
-        HelpBrowserProxy.getInstance().exit();
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/ExitAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ExitAction.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/actions/ExitAction.java	(revision 2715)
@@ -29,5 +29,4 @@
         if (Main.saveUnsavedModifications()) {
             Main.saveGuiGeometry();
-            Main.cleanupBeforeExit();
             System.exit(0);
         }
Index: trunk/src/org/openstreetmap/josm/actions/HelpAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/HelpAction.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/actions/HelpAction.java	(revision 2715)
@@ -12,5 +12,5 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
+import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -43,10 +43,10 @@
             }
             if (topic == null) {
-                HelpBrowserProxy.getInstance().setUrlForHelpTopic("/");
+                HelpBrowser.setUrlForHelpTopic("/");
             } else {
-                HelpBrowserProxy.getInstance().setUrlForHelpTopic(topic);
+                HelpBrowser.setUrlForHelpTopic(topic);
             }
         } else {
-            HelpBrowserProxy.getInstance().setUrlForHelpTopic("/");
+            HelpBrowser.setUrlForHelpTopic("/");
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 2715)
@@ -23,5 +23,5 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
+import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.GBC;
@@ -486,5 +486,5 @@
 
         public void actionPerformed(ActionEvent e) {
-            HelpBrowserProxy.getInstance().setUrlForHelpTopic(helpTopic);
+            HelpBrowser.setUrlForHelpTopic(helpTopic);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2715)
@@ -22,5 +22,5 @@
 import javax.swing.KeyStroke;
 
-import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
+import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -111,5 +111,5 @@
         Action a = new AbstractAction() {
             public void actionPerformed(ActionEvent e) {
-                HelpBrowserProxy.getInstance().setUrlForHelpTopic(helpTopic);
+                HelpBrowser.setUrlForHelpTopic(helpTopic);
             }
         };
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 2715)
@@ -55,5 +55,4 @@
                     return;
                 Main.saveGuiGeometry();
-                Main.cleanupBeforeExit();
                 System.exit(0);
             }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 2715)
@@ -28,5 +28,5 @@
 import org.openstreetmap.josm.gui.conflict.pair.ConflictResolver;
 import org.openstreetmap.josm.gui.conflict.pair.properties.OperationCancelledException;
-import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
+import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -188,5 +188,5 @@
 
         public void actionPerformed(ActionEvent arg0) {
-            HelpBrowserProxy.getInstance().setUrlForHelpTopic("/Dialog/ConflictDialog");
+            HelpBrowser.setUrlForHelpTopic("/Dialog/ConflictDialog");
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java	(revision 2715)
@@ -52,5 +52,5 @@
     public void actionPerformed(ActionEvent e) {
         if (helpTopic != null) {
-            HelpBrowserProxy.getInstance().setUrlForHelpTopic(helpTopic);
+            HelpBrowser.setUrlForHelpTopic(helpTopic);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java	(revision 2714)
+++ 	(revision )
@@ -1,97 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.help;
-
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Toolkit;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.Thread.UncaughtExceptionHandler;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.tools.I18n;
-
-/**
- * The JOSM help browser wrapped in its own application. It is listening to commands
- * on standard in.
- *
- */
-public class HelpApplication {
-    static private final Logger logger = Logger.getLogger(HelpApplication.class.getName());
-    private HelpBrowser browser;
-    private HelpBrowserCommandProcessor commandProcessor;
-
-    protected void setGeometry(HelpBrowser browser) {
-        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
-        d.width = Math.min(800, d.width -50);
-        Rectangle bounds = new Rectangle(
-                new Point(
-                        Toolkit.getDefaultToolkit().getScreenSize().width - d.width,
-                        0
-                ),
-                d
-        );
-        browser.setBounds(bounds);
-    }
-
-    public void start() {
-        browser = new HelpBrowser();
-        setGeometry(browser);
-        commandProcessor = new HelpBrowserCommandProcessor(browser);
-        new Thread(commandProcessor).start();
-    }
-
-    static public void main(String argArray[]) {
-        I18n.init();
-        // initialize the plaform hook, and
-        Main.determinePlatformHook();
-        // call the really early hook before we anything else
-        Main.platform.preStartupHook();
-
-        // construct argument table
-        final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>();
-        for (String arg : argArray) {
-            if (!arg.startsWith("--")) {
-                arg = "--download="+arg;
-            }
-            int i = arg.indexOf('=');
-            String key = i == -1 ? arg.substring(2) : arg.substring(2,i);
-            String value = i == -1 ? "" : arg.substring(i+1);
-            Collection<String> v = args.get(key);
-            if (v == null) {
-                v = new LinkedList<String>();
-            }
-            v.add(value);
-            args.put(key, v);
-        }
-
-        Main.pref.init(false /* don't reset preferences */);
-
-        // Check if passed as parameter
-        if (args.containsKey("language")) {
-            I18n.set((String)(args.get("language").toArray()[0]));
-        } else {
-            I18n.set(Main.pref.get("language", null));
-        }
-        MainApplication.preConstructorInit(args);
-        Thread.setDefaultUncaughtExceptionHandler(
-                new UncaughtExceptionHandler() {
-                    public void uncaughtException(Thread t, Throwable e) {
-                        StringWriter sw = new StringWriter();
-                        e.printStackTrace(new PrintWriter(sw));
-                        logger.log(Level.SEVERE, sw.getBuffer().toString());
-                    }
-                }
-        );
-
-        new HelpApplication().start();
-    }
-}
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 2715)
@@ -7,5 +7,8 @@
 
 import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Point;
 import java.awt.Rectangle;
+import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -32,4 +35,5 @@
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
+import javax.swing.SwingUtilities;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
@@ -48,4 +52,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OpenBrowser;
+import org.openstreetmap.josm.tools.WindowGeometry;
 
 public class HelpBrowser extends JFrame {
@@ -66,4 +71,22 @@
         return instance;
     }
+
+    /**
+     * Show the help page for help topic <code>helpTopic</code>.
+     *
+     * @param helpTopic the help topic
+     */
+    public static void setUrlForHelpTopic(final String helpTopic) {
+        final HelpBrowser browser = getInstance();
+        Runnable r = new Runnable() {
+            public void run() {
+                browser.openHelpTopic(helpTopic);
+                browser.setVisible(true);
+                browser.toFront();
+            }
+        };
+        SwingUtilities.invokeLater(r);
+    }
+
 
     /**
@@ -101,5 +124,5 @@
         BufferedReader reader = new BufferedReader(
                 new InputStreamReader(
-                        getClass().getResourceAsStream("help-browser.css")
+                        getClass().getResourceAsStream("/data/help-browser.css")
                 )
         );
@@ -162,5 +185,22 @@
         });
 
+        setMinimumSize(new Dimension(400, 200));
         setTitle(tr("JOSM Help Browser"));
+    }
+
+    @Override
+    public void setVisible(boolean visible) {
+        if (visible) {
+            new WindowGeometry(
+                    getClass().getName() + ".geometry",
+                    WindowGeometry.centerInWindow(
+                            getParent(),
+                            new Dimension(600,400)
+                    )
+            ).apply(this);
+        } else if (!visible && isShowing()){
+            new WindowGeometry(this).remember(getClass().getName() + ".geometry");
+        }
+        super.setVisible(visible);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserCommandProcessor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserCommandProcessor.java	(revision 2714)
+++ 	(revision )
@@ -1,84 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.help;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.logging.Logger;
-
-import javax.swing.SwingUtilities;
-
-/**
- * Listens to commands on an input stream and delegates them to the help browser.
- *
- *
- */
-public class HelpBrowserCommandProcessor implements Runnable {
-    private static final Logger logger = Logger.getLogger(HelpBrowserCommandProcessor.class.getName());
-
-    /** the controlled help browser*/
-    private HelpBrowser browser;
-
-    /**
-     *
-     * @param browser the controlled help browser
-     */
-    public HelpBrowserCommandProcessor(HelpBrowser browser) {
-        this.browser = browser;
-    }
-
-    /**
-     * Show the help page for help topic <code>helpTopic</code>.
-     *
-     * @param helpTopic the help topic
-     */
-    protected void setUrlForHelpTopic(final String helpTopic) {
-        Runnable r = new Runnable() {
-            public void run() {
-                browser.openHelpTopic(helpTopic);
-                browser.setVisible(true);
-                browser.toFront();
-            }
-        };
-        SwingUtilities.invokeLater(r);
-    }
-
-    /**
-     * Exit the help browser
-     */
-    protected void exit() {
-        Runnable r = new Runnable() {
-            public void run() {
-                browser.setVisible(false);
-                System.exit(0);
-            }
-        };
-        SwingUtilities.invokeLater(r);
-    }
-
-    public void run() {
-        BufferedReader reader = new BufferedReader(
-                new InputStreamReader(
-                        System.in
-                )
-        );
-        while(true) {
-            String cmd = null;
-
-            try {
-                cmd = reader.readLine();
-            } catch(IOException e) {
-                System.out.println(tr("Failed to read command. Exiting help browser. Exception was:" + e.toString()));
-                System.exit(1);
-            }
-            if (cmd.startsWith("exit")) {
-                exit();
-            } else if (cmd.startsWith("setUrlForHelpTopic ")) {
-                String helpTopic = cmd.substring("setUrlForHelpTopic ".length());
-                setUrlForHelpTopic(helpTopic);
-            }
-        }
-    }
-}
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java	(revision 2714)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java	(revision 2715)
@@ -11,6 +11,6 @@
     private int historyPos = 0;
 
-    public HelpBrowserHistory(HelpBrowser brower) {
-        this.browser = brower;
+    public HelpBrowserHistory(HelpBrowser browser) {
+        this.browser = browser;
         history = new ArrayList<String>();
     }
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserProxy.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserProxy.java	(revision 2714)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.help;
-
-import java.io.File;
-import static org.openstreetmap.josm.tools.I18n.tr;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-
-import javax.swing.JOptionPane;
-
-import org.openstreetmap.josm.Main;
-
-/**
- * This is the proxy class for the help browser running in its own process.
- *
- *
- */
-public class HelpBrowserProxy {
-
-    /** the unique instance of the proxy */
-    private static HelpBrowserProxy instance;
-
-    /**
-     * replies the unique instance of the proxy
-     *
-     * @return the unique instance of the proxy
-     */
-    static public HelpBrowserProxy getInstance() {
-        if (instance == null) {
-            instance = new HelpBrowserProxy();
-        }
-        return instance;
-    }
-
-    /** the process running the help browser */
-    private Process helpBrowserProcess;
-    /** the print writer to the input stream of the help browser process */
-    private PrintWriter pw;
-
-    /**
-     * launches the help browser in its own process
-     *
-     */
-    protected void launch() {
-        ArrayList<String> cmdLine = new ArrayList<String>();
-        String javaBin = null;
-        if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
-            javaBin = "javaw.exe";
-        } else {
-            javaBin = "java";
-        }
-        cmdLine.add(new File(new File(System.getProperty("java.home"), "bin"), javaBin).toString());
-        cmdLine.add("-classpath");
-        cmdLine.add(System.getProperty("java.class.path"));
-        cmdLine.add("org.openstreetmap.josm.gui.help.HelpApplication");
-        if (System.getProperty("josm.home") != null) {
-            cmdLine.add("-Djosm.home="+System.getProperty("josm.home"));
-        }
-        String[] cmds = new String[cmdLine.size()];
-        cmdLine.toArray(cmds);
-        try {
-            helpBrowserProcess = Runtime.getRuntime().exec(cmds);
-        } catch(IOException e) {
-            e.printStackTrace();
-        }
-        if (helpBrowserProcess != null) {
-            pw = new PrintWriter(
-                    new OutputStreamWriter(
-                            helpBrowserProcess.getOutputStream()
-                    )
-            );
-        }
-    }
-
-    /**
-     * Direct the help browser to the help page for help topic
-     * <code>relativeHelpTopic</code>
-     *
-     * @param relativeHelpTopic the help topic
-     */
-    public void setUrlForHelpTopic(String relativeHelpTopic) {
-        if (helpBrowserProcess == null) {
-            launch();
-        }
-        if (helpBrowserProcess == null) {
-            JOptionPane.showMessageDialog(
-                    Main.parent,
-                    tr("Failed to launch the external help browser"),
-                    tr("Error"),
-                    JOptionPane.ERROR_MESSAGE
-            );
-            System.err.println("Failed to launch browser");
-            return;
-        }
-        pw.println("setUrlForHelpTopic " + relativeHelpTopic);
-        pw.flush();
-    }
-
-    /**
-     * Exit the help browser
-     */
-    public void exit() {
-        if (helpBrowserProcess == null)
-            return;
-        pw.println("exit");
-        pw.flush();
-        pw.close();
-        helpBrowserProcess.destroy();
-    }
-}
Index: trunk/src/org/openstreetmap/josm/gui/help/help-browser.css
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/help-browser.css	(revision 2714)
+++ 	(revision )
@@ -1,45 +1,0 @@
-@CHARSET "ISO-8859-1";
-/*
- * This is the CSS file used in the internal help browser
- */
-body {margin-left: 0.2cm; font-family: Arial, sans-serif; font-size:14pt; font-weight:normal}
-p {margin-top: 5px; margin-bottom: 5px;}
-h1 {font-family: Arial, sans-serif; font-size:24pt; font-weight:bold}
-h2 {margin-top: 14pt; font-family: Arial, sans-serif; font-size:20pt; font-weight:bold}
-h3 {margin-top: 14pt; font-family: Arial, sans-serif; font-size:16pt; font-weight:bold}
-h4 {margin-top: 14pt; font-family: Arial, sans-serif; font-size:14pt; font-weight:bold}
-a {font-family: Arial, sans-serif; font-size:14pt; font-weight:normal; text-decoration: underline; color: blue}
-ul {margin-left: 1cm; list-style-type: disc}
-ul ul {margin-left: 1cm; list-style-type: circle}
-ol {margin-left: 1cm;}
-strong {font-weight: bold}
-b {font-weight: bold}
-em {font-style: italic}
-i {font-style: italic}
-tt {font-family: Courier New}
-pre {font-family: Courier New}
-.warning-header {
-	font-family: Arial, sans-serif; 
-	font-size:24pt; 
-	font-weight:bold
-}
-.warning-body {
-	background-color:rgb(253,255,221);
-	padding: 10pt; 
-	border-color:rgb(128,128,128);
-	border-style: solid; 
-	border-width: 1px;
-}
-
-.error-header {
-	font-family: Arial, sans-serif; 
-	font-size:24pt; 
-	font-weight:bold
-}
-.error-body {
-	background-color:rgb(254,195,190);
-	padding: 10pt; 
-	border-color:rgb(128,128,128);
-	border-style: solid; 
-	border-width: 1px;
-}
