function highs_init()
    ENGINE.modules.highs = ENGINE.modules.highs or {}
    local obj = ENGINE.modules.highs
    function obj:init() 
        g2.game_reset()
        g2.view_set(0,0,640,480)
        g2.play_music("mus-legends-menu")
        g2.bkgr_src = "background05"
        g2.state = "overlay"
        
        local html = "<table>"
        html = html .. "<tr><td colspan=3><input type='button' class='button2' value='Back' onclick='back' />"
        html = html .. "<tr><td><h3>&nbsp;</h3>"
        for i=1,23 do
            local v =  i..". "..LEVELS[i].title
--             if (i%2) == 1 then html = html .. "<tr>" end
            html = html .. "<tr>"
            html = html .. "<td><input type='button' value=\"Level "..i.."\" onclick='"..i.."' class='button2' width = 100/>"
            html = html .. "<td><p>&nbsp;&nbsp;</p>";
            html = html .. "<td align=left><p>"..LEVELS[i].title.."</p>"
--             html = html .. "<td><input type='button' value=\""..v.."\" onclick='"..i.."' class='button2' width = 150/>"
        end
        html = html .. "<tr><td><h3>&nbsp;</h3>"
        html = html .. "<tr><td colspan=3><input type='button' class='button2' value='Back' onclick='back' />"
        html = html .. "</table>"
        g2.html = html
    
    end
    function obj:loop(t)
    end
    function obj:event(e) 
        
        if (e["type"] == "onclick" and mknumber(e["value"]) > 0) then
            obj.current_level = mknumber(e["value"])
            g2_ext_call("legends:leaderboard",json.encode({lid=obj.current_level}))
        end
        if (e["type"] == "onclick" and e["value"]:find("leaderboard:") == 1) then
            local q = e.value:sub(e.value:find(":")+1,-1)
            g2_ext_call("legends:leaderboard",json.encode({lid=obj.current_level,q=q}))
        end
        if (e["type"] == "onclick" and e["value"] == "leaderboard_back") then
            self:init()
        end

        if (e["type"] == "api:leaderboard") then
            g2.state = "overlay"
            g2.html = "<table>"..
                "<tr><td><input type='button' class='button2' value='Back' onclick='leaderboard_back' />"..
                "<tr><td><h3>&nbsp;</h3>"..
                "<tr><td>"..e.value..
                "<tr><td><h3>&nbsp;</h3>"..
                "<tr><td><input type='button' class='button2' value='Back' onclick='leaderboard_back' />"..
                "</table>"
        end
        
        if (e["type"] == "onclick" and e["value"] == "back") then
            ENGINE.engine:next(ENGINE.modules.title)
        end
        
        if e.type == 'quit' then
            ENGINE.engine:next(ENGINE.modules.title)
            g2.quit = false
        end
    end
end
