serverframe5.html

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

    <body>

    <input value="Overlay multiple serverFrames" type=button onclick="submitAll()">

    <script>

    w = new win(50,50,400,400,"overlay window","win.html")

    function submitAll() {
        for (var i=1;i<=2;i++) {
            var s = w.serverFrames[i]
            s.setVar("map_countries_class_color",
                Math.round(Math.random() * 255) + " "  +
                Math.round(Math.random() * 255) + " "  +
                Math.round(Math.random() * 255)
            )
            s.setVar("mapsize",w.contentWidth + " " + w.contentHeight)
        }
        w.submit()
    }

    function displayMap(s) {
        var mapimg = w.contentWindow.document.getElementsByTagName("img")[s.imgnr]
        var mapurl = s.getVar("img")
        mapimg.src = mapurl
    }

    w.setExecOnResize(submitAll)

    s1 = w.addServerFrame()
    s1.setServerURL(MSURL)
    s1.setVar("map",MSMAP)
    s1.setVar("map_projection","proj=sinu,ellps=clrk66")
    s1.setVar("mapext","-20000000 -10000000 20000000 10000000")

    s2 = w.addServerFrame()
    s2.setServerURL(MSURL)
    s2.setVar("map",MSMAP)
    s2.setVar("map_projection","proj=gall,ellps=clrk66")
    s2.setVar("mapext","-20000000 -10000000 20000000 10000000")

    s3 = w.addServerFrame()
    s3.imgnr = 0
    s3.setExecOnReturn(displayMap)

    s4 = w.addServerFrame()
    s4.imgnr = 1
    s4.setExecOnReturn(displayMap)

    s1.setTarget(s3)
    s2.setTarget(s4)
    </script>
    </body>