Index: data/media/gui/scripts/gui.lua
===================================================================
--- data/media/gui/scripts/gui.lua	(revision 5491)
+++ data/media/gui/scripts/gui.lua	(revision 5491)
@@ -0,0 +1,36 @@
+-- gui.lua
+
+local P = {}
+if _REQUIREDNAME == nil then
+    gui = P
+else
+    _G[_REQUIREDNAME] = P
+end
+
+P.overlay = nil
+
+-- constructor of the GUI
+function P:new (gui, fname)
+    local newElement = { window = gui, filename = fname, visible = false } or {}
+    setmetatable(newElement, self) -- connects new element with class
+    self.__index = self
+    return newElement
+end
+
+-- hide function for the GUI
+function P:hide ()
+    self.window:hide()
+    self.visible = false
+end
+
+-- show function for the GUI
+function P:show ()
+    self.window:show()
+    self.visible = true
+end
+
+function P:load ()
+    return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename)
+end
+
+return gui or _G[_REQUIREDNAME]
Index: data/media/gui/scripts/loadGUI_3.lua
===================================================================
--- data/media/gui/scripts/loadGUI_3.lua	(revision 5491)
+++ data/media/gui/scripts/loadGUI_3.lua	(revision 5491)
@@ -0,0 +1,86 @@
+local schemeMgr = CEGUI.SchemeManager:getSingleton()
+winMgr = CEGUI.WindowManager:getSingleton()
+local logger = CEGUI.Logger:getSingleton()
+local system = CEGUI.System:getSingleton()
+local cursor = CEGUI.MouseCursor:getSingleton()
+
+schemeMgr:loadScheme("TaharezLookSkin.scheme")
+-- load scheme with our own images
+schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
+
+system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+system:setDefaultFont("BlueHighway-12")
+
+loadedGUIs = {}
+
+-- datapath is set before executing the script and points to media-folder
+package.path = package.path .. ";" .. datapath .. "gui/scripts/?.lua"
+
+-- loads the GUI with the specified filename
+-- be sure to set the global variable "filename" before calling this function
+function loadGUI(filename)
+    -- check if it already exists
+    loadedGui = loadedGUIs[filename]
+    if loadedGui == nil then
+        loadedGuiNS = require(filename)
+        loadedGui = loadedGuiNS:load()
+        loadedGUIs[filename] = loadedGui
+        -- if there has no GUI been loaded yet, set new GUI as current
+        if #loadedGUIs == 1 then
+            current = loadedGUIs[1]
+            showing = false
+        end
+        -- hide new GUI as we do not want to show it accidentially
+        loadedGui:hide()
+    end
+    return loadedGui
+end
+
+function showGUI(filename, ptr)
+    gui = showGUI(filename)
+    gui.overlay = ptr
+end
+
+-- shows the specified and loads it if not loaded already
+-- be sure to set the global variable "filename" before calling this function
+function showGUI(filename)
+    if current == nil or current.filename ~= filename then
+        current = loadedGUIs[filename]
+        if current == nil then
+            current = loadGUI(filename)
+        end
+        system:setGUISheet(current.window)
+    end
+    current:show()
+    showing = true
+    return current
+end
+
+function toggleGUI()
+    if showing == true then
+        current:hide()
+        cursor:hide()
+        showing = false
+    else
+        current:show()
+        cursor:show()
+        showing = true
+    end
+    return showing
+end
+
+function hideCursor()
+    cursor:hide()
+end
+
+function showCursor()
+    cursor:show()
+end
+
+function hideGUI(filename)
+    current = loadedGUIs[filename]
+    if current ~= nil then
+        current:hide()
+        showing = false
+    end
+end
Index: data/media/gui/scripts/mainmenu_2.lua
===================================================================
--- data/media/gui/scripts/mainmenu_2.lua	(revision 5491)
+++ data/media/gui/scripts/mainmenu_2.lua	(revision 5491)
@@ -0,0 +1,50 @@
+-- mainmenu_2.lua
+gui = require("gui")
+local P = gui:new() --inherit everything from the gui package
+
+mainmenu_2 = P
+
+P.filename = "mainmenu_2"
+P.layoutString = "MainMenu_2.layout"
+
+-- overwrites load function of previous load function
+function P:load()
+    element = P.__index.load(P) -- calling load function of parent class with ourselves and do other stuff now
+    --win = winMgr:getWindow("orxonox/LevelListBox")
+    --print(win.getItemCount())
+    --item = winMgr:createWindow("TaharezLook/ListboxItem", "orxonox/LevelListBoxItem1")
+    --item:setText("HiHo")
+    --win:addItem(item)
+    --print(win:getItemCount())
+    return element
+end
+
+
+-- events for mainmenu
+function P.button_quit_clicked(e)
+  hideGUI()
+  orxonox.CommandExecutor:execute("exit")
+end
+
+function P.button_standalone_clicked(e)
+  orxonox.CommandExecutor:execute("startGame")
+  toggleGUI()
+end
+
+function P.button_server_clicked(e)
+  orxonox.CommandExecutor:execute("echo Not yet supported!")
+  hideGUI()
+end
+
+function P.button_dedicated_clicked(e)
+  orxonox.CommandExecutor:execute("echo Not yet supported!")
+  hideGUI()
+end
+
+function P.button_client_clicked(e)
+  orxonox.CommandExecutor:execute("echo Not yet supported!")
+  hideGUI()
+end
+
+return mainmenu_2
+
