    <head><title>button4.html</title>
    <script src=../window.js></script>
    <script src=../examples.js></script>
    </head>

    <body>
    <script>

    w = new win(100,100,300,300,"button")
    w.setServerURL(MSURL)
    w.setVar("map",MSMAP)

    b = new button('<img id=buttonimg style="width:50;height:50">',null)
    m = new menu()
    m.addButton(b)
    m.realSticky(true)
    m.showAt(40,500)

    function submitWin() {
        w.setVar("mapsize",w.contentWidth + " " + w.contentHeight)
        var n = document.getElementById("msname").value
        var v = document.getElementById("msvalue").value
        if (n) w.setVar(n,v)
        w.submit()
    }
    w.setExecOnResize(submitWin)

    function putMenu() {
        var simg = w.getReturnedVar("img")
        var bimg = document.getElementById("buttonimg")
        bimg.src = simg
    }

    w.setExecOnReturn(putMenu)

    </script>
    <input type=button value="Submit Map" onclick="submitWin()">
    <br>
    MS-variable: name <input type=text id=msname>
    <br>
    MS-variable: value <input type=text id=msvalue>

    </body>