Index: code/branches/tutoriallevel2/data/gui/layouts/QuestGUI.layout
===================================================================
--- code/branches/tutoriallevel2/data/gui/layouts/QuestGUI.layout	(revision 8369)
+++ code/branches/tutoriallevel2/data/gui/layouts/QuestGUI.layout	(revision 8371)
@@ -1,23 +1,78 @@
 <?xml version="1.0" ?>
 <GUILayout>
-    <Window Type="MenuWidgets/StaticImage" Name="orxonox/QuestGUI/Background">
-    <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
-    <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
-    <Property Name="FrameEnabled" Value="set:true"/>
-    <Property Name="BackgroundEnabled" Value="set:false"/>
-    <Property Name="InheritsAlpha" Value="False" />
+    <Window Type="DefaultWindow" Name="orxonox/QuestGUI/Background">
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
 
-        <Window Type="MenuWidgets/Titlebar" Name="orxonox/QuestGUI/Title">
-            <Property Name="UnifiedPosition" Value="{{0.05,0},{0.05,0}}"/>
-            <Property Name="UnifiedSize" Value="{{0.9,0},{0.05,0}}"/>
-            <Property Name="Text" Value="Your Quests"/>
+        <Window Type="DefaultWindow" Name="orxonox/QuestGUI/MainWindow">
+            <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.1,0},{0.9,0},{0.9,0}}" />
+
+            <Window Type="MenuWidgets/Titlebar" Name="orxonox/QuestGUI/Title">
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{0,30}}" />
+                <Property Name="Text" Value="Your Quests"/>
+            </Window>
+
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/MainWindow/LeftPanel">
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0,30},{0.5,0},{1,0}}" />
+
+                <Window Type="MenuWidgets/TabButton" Name="orxonox/QuestGUI/ActiveQuestsButton">
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.5,0},{0,30}}" />
+                    <Property Name="Text" Value="active quests"/>
+                    <Event Name="Clicked" Function="QuestGUI.showActiveQuestsButton_clicked"/>
+                </Window>
+                <Window Type="MenuWidgets/TabButton" Name="orxonox/QuestGUI/FinishedQuestsButton">
+                    <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0,0},{1,0},{0,30}}" />
+                    <Property Name="Text" Value="finished quests"/>
+                    <Event Name="Clicked" Function="QuestGUI.showFinishedQuestsButton_clicked"/>
+                </Window>
+
+                <Window Type="MenuWidgets/Listbox" Name="orxonox/QuestGUI/QuestsList">
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,30},{1,0},{1,0}}" />
+                    <Event Name="ItemSelectionChanged" Function="QuestGUI.changeQuest_clicked"/>
+                </Window>
+            </Window>
+
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/MainWindow/RightPanel">
+                <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0,30},{1,0},{1,0}}" />
+
+                <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/Quest/Title">
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{0,30}}" />
+                    <Property Name="Text" Value="Quest Title"/>
+                </Window>
+
+                <Window Type="MenuWidgets/ScrollablePane" Name="orxonox/QuestGUI/Quest/ScrollWrapper">
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,30},{1,-4},{1,-4}}" />
+
+                    <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/Quest/Wrapper">
+                        <Property Name="UnifiedAreaRect" Value="{{0,5},{0,5},{1,-5},{0,0}}" />
+                        <Property Name="FrameEnabled" Value="false" />
+                        <Property Name="Alpha" Value="0" />
+
+                        <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/Quest/Description">
+                            <Property Name="UnifiedAreaRect" Value="{{0,5},{0,0},{1,-5},{0,0}}" />
+                            <Property Name="InheritsAlpha" Value="False" />
+                            <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
+                            <Property Name="VertFormatting" Value="TopAligned" />
+                            <Property Name="FrameEnabled" Value="false" />
+                            <Property Name="Text" Value="Quest Description"/>
+                        </Window>
+
+                        <Window Type="MenuWidgets/Listbox" Name="orxonox/QuestGUI/Quest/SubquestsList">
+                            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+                            <Property Name="InheritsAlpha" Value="False" />
+                            <Event Name="ItemSelectionChanged" Function="QuestGUI.changeToSubquest_clicked"/>
+                        </Window>
+
+                        <Window Type="MenuWidgets/StaticText" Name="orxonox/QuestGUI/Quest/Hints">
+                            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{0,0}}" />
+                            <Property Name="InheritsAlpha" Value="False" />
+                            <Property Name="VertFormatting" Value="TopAligned" />
+                            <Property Name="FrameEnabled" Value="false" />
+                            <Property Name="Text" Value="Hints:" />
+                        </Window>
+                    </Window>
+                </Window>
+            </Window>
         </Window>
-
-        <Window Type="MenuWidgets/Listbox" Name="orxonox/QuestGUI/QuestsList">
-            <Property Name="UnifiedPosition" Value="{{0.07,0},{0.18,0}}" />
-            <Property Name="UnifiedSize" Value="{{0.86,0},{0.8,0}}" />
-            <Property Name="Alpha" Value="0.8" />
-        </Window>
-
     </Window>
 </GUILayout>
Index: code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua	(revision 8369)
+++ code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua	(revision 8371)
@@ -17,18 +17,26 @@
 function P.createQueue(name, size)
     local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
-    local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name)
-    queue:setProperty("BackgroundColor", "00FFFFFF") -- Set background to be fully transparent.
+    --local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name)
+    --queue:setProperty("BackgroundColor", "00FFFFFF") -- Set background to be fully transparent.
+    local queue = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/NotificationLayer/Root/Queue/" .. name)
+    queue:setProperty("Alpha", 0.0)
+    --queue:setProperty("FrameEnabled", "false")
     root:addChildWindow(queue)
-
-    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
-    queue:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queue, size))))
 
     local queueTuple =
     {
-        ["window"]  = queue,
-        ["name"]    = name,
-        ["edit"]    = nil,
-        ["visible"] = false
+        ["window"]    = queue,
+        ["name"]      = name,
+        ["edit"]      = nil,
+        ["visible"]   = false,
+        ["fontSize"]  = 12,
+        ["fontColor"] = "#FFFFFFFF",
+        ["items"]     = {},
+        ["first"]     = 1,
+        ["last"]      = 1
     }
+    
+    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
+    queue:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queueTuple, size))))
 
     P.queueList[name] = queueTuple -- name access
@@ -52,12 +60,25 @@
         return
     end
-    item = CEGUI.createListboxTextItem(notification)
-    local listbox = CEGUI.toListbox(queue.window)
-    -- Add the item to the top of the listbox.
-    if listbox:getItemCount() == 0 then
-        listbox:addItem(item)
-    else
-        listbox:insertItem(item, listbox:getListboxItemFromIndex(0))
-    end
+
+    local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Queue/" .. queueName .. "/" .. queue.last)
+    item:setText(notification)
+    P.setItemFontHelper(item, queue, true)
+    -- Add the item to the top of the queue.
+    local itemHeight = P.itemHeightHelper(queue)
+    if queue.last-queue.first > 0 then -- If the queue is not empty move all items down
+        for i=queue.first,queue.last-1 do
+            local item = queue.items[i]
+            item:setYPosition(CEGUI.UDim(0, itemHeight*(queue.last-i)))
+        end
+    end
+    queue.window:addChildWindow(item)
+    item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, itemHeight)))
+    item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
+    item:setProperty("Alpha", 1.0)
+    item:setProperty("InheritsAlpha", "false")
+    item:setProperty("BackgroundEnabled", "false")
+    item:setProperty("FrameEnabled", "false")
+    queue.items[queue.last] = item
+    queue.last = queue.last+1
 
     -- If the queue has been invisible, set it to visible.
@@ -73,15 +94,17 @@
         return
     end
-    local listbox = CEGUI.toListbox(queue.window)
-    -- Removes the item from the bottom of the listbox.
-    listbox:removeItem(listbox:getListboxItemFromIndex(listbox:getItemCount()-1))
+    local item = queue.items[queue.first]
+    -- Removes the item from the bottom of the queue.
+    queue.window:removeChildWindow(item)
+    winMgr:destroyWindow(item)
+    queue.first = queue.first+1
 
     -- Sets the queue to invisible if there are no more notifications in it.
-    if listbox:getItemCount() == 0 then
+    if queue.last-queue.first == 0 then
         P.setVisible(queue, false)
     end
 end
 
--- Removes a notification at a given index from the queue.
+-- Removes a notification at a given index from the queue. Where the 0th item is the newest and the nth the (n+1)th newest.
 function P.removeNotification(queueName, index)
     local queue = P.queueList[queueName]
@@ -89,10 +112,33 @@
         return
     end
-    local listbox = CEGUI.toListbox(queue.window)
+
+    index = queue.last-tonumber(index)-1
+    --if index == queue.first then -- If we want to remove the oldest notification, we can just use pop.
+    --    P.popNotification(queueName)
+    --    return
+    --end
+
     -- Removes the item.
-    listbox:removeItem(listbox:getListboxItemFromIndex(tonumber(index)))
+    local item = queue.items[index]
+    queue.window:removeChildWindow(item)
+    winMgr:destroyWindow(item)
+    queue.items[index] = nil
+
+    -- Move the items below, up.
+    local itemHeight = P.itemHeightHelper(queue)
+    local moved = false
+    if index > queue.first then -- Move all older notifications up in the list.
+        for i=index-1,-1,queue.first do
+            cout(0, i)
+            item = queue.items[i]
+            item:setYposition(CEGUI.UDim(0, itemHeight*(queue.last-i-1)))
+            queue.items[i+1] = item
+        end
+    end
+    queue.items[queue.first] = nil
+    queue.first = queue.first+1
 
     -- Sets the queue to invisible if there are no more notifications in it.
-    if listbox:getItemCount() == 0 then
+    if queue.last-queue.first == 0 then
         P.setVisible(queue, false)
     end
@@ -105,6 +151,12 @@
         return
     end
-    local listbox = CEGUI.toListbox(queue.window)
-    CEGUI.toListbox(queue.window):resetList()
+    for i=queue.first,queue.last-1 do
+        local item = queue.items[i]
+        queue.window:removeChildWindow(item)
+        winMgr:destroyWindow(item)
+    end
+    queue.items = {}
+    queue.first = 1
+    queue.last = 1
 
     -- Sets the queue to invisible.
@@ -119,4 +171,62 @@
     queue.window:setVisible(visible)
     queue.visible = visible
+end
+
+-- Change the position of the queue.
+-- The parameters are (in order) 'name of the queue', 'relative x-position', 'absolute x-position in pixel', 'relative y-position', 'absolute y-position in pixel'.
+function P.moveQueue(queueName, relativeXPos, absoluteXPos, relativeYpos, absoluteYPos)
+    local queueWindow = P.queueList[queueName].window
+    queueWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(relativeXPos, absoluteXPos), CEGUI.UDim(relativeYpos, absoluteYPos)))
+end
+
+-- Change the size of the queue.
+-- The parameters are (in order) 'name of the queue', 'relative width', 'absolute width in pixel', 'relative height', 'absolute heigth in pixel'.
+-- Additionally the last parameter can be ommitted and relativeHeight can be set to the size (i.e. the maximal number of notifications displayed) of the queue, which leads to the height being set such that all notifications can be displayed.
+function P.resizeQueue(queueName, relativeWidth, absoluteWidth, relativeHeight, absoluteHeigth)
+    local queueWindow = P.queueList[queueName].window
+    if queueWindow == nil then
+        return
+    end
+    if absoluteHeigth == nil then
+        absoluteHeigth = P.queueHeightHelper(P.queueList[queueName], relativeHeight)
+        relativeHeight = 0
+    end
+    queueWindow:setSize(CEGUI.UVector2(CEGUI.UDim(relativeWidth, absoluteWidth), CEGUI.UDim(relativeHeight, absoluteHeigth)))
+end
+
+-- Change the font size and font color of all notifications in a queueHeightHelper
+-- The parameters are (in order) 'name of the queue', 'font size', 'RGBA of the font color in hex notation'.
+function P.changeQueueFont(queueName, size, color)
+    local queue = P.queueList[queueName]
+    local queueWindow = queue.window
+    if queueWindow == nil then
+        return
+    end
+
+    queue.fontSize = size
+    local changeColor = false
+    if color ~= nil then
+        queue.fontColor = color
+        changeColor = true
+    end
+    for i=queue.first,queue.last-1 do
+        P.setItemFontHelper(queue.items[i], queue, changeColor)
+    end
+end
+
+-- Helper function to set the font size and color of a item of a queue.
+-- The parameters are (in order) 'the ListboxItem', 'the queue table', 'whether color should be changed as well'
+function P.setItemFontHelper(item, queue, changeColor)
+    --local item = tolua.cast(item, "CEGUI::ListboxTextItem")
+    local fontMgr = CEGUI.FontManager:getSingleton()
+    if fontMgr:isFontPresent("BlueHighway-" .. queue.fontSize) then
+        item:setFont("BlueHighway-" .. queue.fontSize)
+    else
+        orxonox.GUIManager:addFontHelper("BlueHighway-" .. queue.fontSize, queue.fontSize, "bluehigh.ttf")
+        item:setFont("BlueHighway-" .. queue.fontSize)
+    end
+    if changeColor then
+        --item:setProperty("TextColours", "tl:[" .. queue.fontColor .. "] tr:[" .. queue.fontColor .. "] bl:[" .. queue.fontColor .. "] br:[" .. queue.fontColor .. "]")
+    end
 end
 
@@ -333,5 +443,5 @@
 
 -- Is called after the sheet has been hidden.
-function P.onQuit()
+function P.afterHide()
     -- If we leave the edit mode we show the sheet again.
     if P.editMode then
@@ -342,5 +452,5 @@
 
 -- If the button to save the targets of a queue has been clicked.
-function P. saveTargets_clicked(e)
+function P.saveTargets_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
     local name = we.window:getName()
@@ -369,5 +479,5 @@
 
 -- If the button to save the size if a queue has been clicked.
-function P. saveSize_clicked(e)
+function P.saveSize_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
     local name = we.window:getName()
@@ -396,5 +506,5 @@
 
 -- If the button to save the display time if a queue has been clicked.
-function P. saveDisplayTime_clicked(e)
+function P.saveDisplayTime_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
     local name = we.window:getName()
@@ -478,13 +588,29 @@
 -- Helper function. Returns height a queue needs to have to display 'size' items.
 function P.queueHeightHelper(queue, size)
-    local listbox = CEGUI.toListbox(queue)
-    local item = CEGUI.createListboxTextItem("Text")
-    listbox:addItem(item)
-    local singleItemHeight = listbox:getTotalItemsHeight()
-    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel())
-    local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue)
-    local frameHeight = queue:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
-    listbox:removeItem(item)
-    return frameHeight + singleItemHeight*size
+    --local listbox = CEGUI.toListbox(queue.window)
+    --local item = CEGUI.createListboxTextItem("Text")
+    --P.setItemFontHelper(item, queue, false)
+    --listbox:addItem(item)
+    --local singleItemHeight = listbox:getTotalItemsHeight()
+    local singleItemHeight = P.itemHeightHelper(queue)
+    --local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue.window:getLookNFeel())
+    --local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue.window)
+    --local frameHeight = queue.window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
+    --listbox:removeItem(item)
+    --return frameHeight + singleItemHeight*size
+    return singleItemHeight*size + 1
+end
+
+function P.itemHeightHelper(queue)
+    local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Test/")
+    item:setText("text")
+    P.setItemFontHelper(item, queue, true)
+    queue.window:addChildWindow(item)
+    item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(1, 0)))
+    item:setProperty("FrameEnabled", "false")
+    local height = getStaticTextWindowHeight(item)
+    queue.window:removeChildWindow(item)
+    winMgr:destroyWindow(item)
+    return height
 end
 
Index: code/branches/tutoriallevel2/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/branches/tutoriallevel2/data/gui/scripts/QuestGUI.lua	(revision 8369)
+++ code/branches/tutoriallevel2/data/gui/scripts/QuestGUI.lua	(revision 8371)
@@ -3,31 +3,321 @@
 local P = createMenuSheet("QuestGUI")
 
-P.rootWindow = nil
-P.detailsWindows = {}
+P.questManager = nil -- The QuestManager.
+P.showActive = true -- Whether the active or finished quest list is displayed.
+P.currentQuest = nil -- The quest that is currently displayed.
+P.player = nil -- The player the quests are displayed for.
 P.quests = {}
-P.hints = {}
-P.player = nil
+P.subquests = {}
 
 -- design parameters
-P.indentWidth = 20
 P.scrollbarWidth = 13
-P.buttonHeight = 30
+P.frameHeigth = 18
+P.borderSize = 5
 P.titleHeight = 26
-P.borderWidth = 5
+
+--TODO:
+-- Highlight whether we are currently looking at active or finished quests
+-- Distinguish completed from failed quests
+
+function P.onLoad()
+    P.questManager = orxonox.QuestManager:getInstance() -- Store the pointer to the QuestManager as an internal variable to allow for faster access,
+end
 
 function P.onShow()
-
-    local questsList = winMgr:getWindow("orxonox/QuestGUI/QuestsList")
-
+    -- Get the player.
     P.player = orxonox.GUIManager:getInstance():getPlayer(P.name)
-    P.rootWindow = P.createQuestGUI()
-
-    questsList:addChildWindow(P.rootWindow)
-end
-
-function P.onHide()
-    P.cleanup()
-end
-
+
+    -- Load the list of quests to be displayed.
+    P.loadQuestsList(P.currentQuest)
+end
+
+-- Loads the list of quests, depending on P.showActive, either the active (P.showActive == true) or the finished, i.e. inactive quests are loaded.
+-- selectQuest is a pointer to a quest that should be selected, if it is nil the first quest is selected.
+function P.loadQuestsList(selectQuest)
+    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    P.clearQuestList()
+
+    local selectQuestId = nil
+    if selectQuest ~= nil then
+        selectQuestId = P.questManager:getId(selectQuest)
+    end
+
+    -- Iterate through all root-quests.
+    local numRootQuests = P.questManager:getNumRootQuests(P.player)
+    if numRootQuests > 0 then
+        local i = 0
+        while i <= numRootQuests-1 do
+            local quest = P.questManager:getRootQuest(P.player, i)
+            -- Insert the current quest into the list.
+            local item = P.insertQuest(list, quest)
+            -- If the quest was inserted in the list and is has the same id as the selectQuest (thus it is the same quest) it is selected.
+            if selectQuestId ~= nil and item ~= nil and selectQuestId == P.questManager:getId(quest) then
+                list:setItemSelectState(item, true)
+            end
+            -- Insert all subquests of this rootquest.
+            P.insertSubQuests(list, quest, selectQuestId)
+            i = i+1
+        end
+        -- If there were quests added to the list but there was no selectQuest specified (i.e. selectQuest was nil), the first item is selected.
+        if list:getItemCount() > 0 then
+            if selectQuestId == nil then
+                list:setItemSelectState(list:getListboxItemFromIndex(0), true)  -- Select first quest.
+            end
+        -- If there werent any quests added the standard "no quests" message is loaded.
+        else
+            P.loadQuest()
+        end
+    end
+end
+
+-- Helper function, recursively inserts all the (active or inactive, depending on P.showActive) subquests of the input quest.
+-- list is the list into which the subquests should be insterted.
+-- quest is the quest, whose subquests should be inserted.
+-- selectQuestId is the id of the quest that should be selected.
+function P.insertSubQuests(list, quest, selectQuestId)
+    -- Iterate through all sub-quests.
+    local numQuests = P.questManager:getNumSubQuests(quest, P.player)
+    if numQuests > 0 then
+        local i = 0
+        while i <= numQuests-1 do
+            local subquest = P.questManager:getSubQuest(quest, P.player, i)
+            -- Insert the current quest into the list.
+            local item = P.insertQuest(list, subquest)
+            -- If the quest was inserted in the list and is has the same id as the selectQuest (thus it is the same quest) it is selected.
+            if selectQuestId ~= nil and item ~= nil and selectQuestId == P.questManager:getId(subquest) then
+                list:setItemSelectState(item, true)
+            end
+            i = i+1
+        end
+    end
+end
+
+-- Helper function, inserts a quest into the list (depending whether active or inactive quests are being shown). Returns nil if the quest was not inserted.
+-- list is the list into which the quets should be inserted.
+-- quest is the quest to be inserted.
+function P.insertQuest(list, quest)
+    if P.showActive == quest:isActive(P.player) then
+        local item = CEGUI.createListboxTextItem(P.questManager:getDescription(quest):getTitle())
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+        list:addItem(item)
+        table.insert(P.quests, quest)
+        return item
+    end
+    return nil
+end
+
+-- Loads the input quest.
+-- quest the quest to be loaded.
+function P.loadQuest(quest)
+
+    P.clearQuest() -- Clear the old quest.
+    if quest == nil then -- If quets is nil there is nothing to display.
+        return
+    else
+        local offset = 0
+
+        -- Load title and description
+        local description = P.questManager:getDescription(quest)
+        local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
+        titleWindow:setText(description:getTitle())
+        local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
+        descriptionWindow:setText(description:getDescription())
+        descriptionWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
+        descriptionWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, P.borderSize)))
+        local height = getStaticTextWindowHeight(descriptionWindow)
+        descriptionWindow:setHeight(CEGUI.UDim(0, height))
+        offset = offset + height
+
+        -- Load subquests
+        local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
+        local numQuests = P.questManager:getNumSubQuests(quest, P.player)
+        local i = 0
+        while i <= numQuests-1 do
+            local quest = P.questManager:getSubQuest(quest, P.player, i)
+            local item = CEGUI.createListboxTextItem(P.questManager:getDescription(quest):getTitle())
+            item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+            list:addItem(item)
+            table.insert(P.subquests, quest)
+            i = i+1
+        end
+        height = list:getTotalItemsHeight()
+        if height > 0 then
+            height = height+P.frameHeigth
+        end
+        list:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))
+        list:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
+        offset = offset + height + P.borderSize
+
+        -- Load hints
+        local hintsWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
+        hintsWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
+        hintsWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))
+        height = P.titleHeight
+        local numHints = P.questManager:getNumHints(quest, P.player)
+        local i = 0
+        while i <= numHints-1 do
+            local hint = P.questManager:getHints(quest, P.player, i)
+            height = height + P.insertHint(hintsWindow, hint, i, height)
+            i = i+1
+        end
+        if numHints == 0 then
+            height = 0
+        end
+        hintsWindow:setHeight(CEGUI.UDim(0, height))
+        offset = offset + height
+
+        -- Set the size of the wrapper
+        local window = winMgr:getWindow("orxonox/QuestGUI/Quest/Wrapper")
+        window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
+    end
+
+    P.currentQuest = quest
+end
+
+-- Clear the currently displayed quest.
+function P.clearQuest()
+    -- clear title
+    local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
+    titleWindow:setText("no Quests")
+
+    -- clear description
+    local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
+    descriptionWindow:setText("There is currently no quest that can be displayed.")
+
+    -- clear list fo subquests
+    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
+    list:resetList()
+    list:setHeight(CEGUI.UDim(0, 0))
+    P.subquests = {}
+
+    -- clear hints
+    local hints = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
+    local numChildren = hints:getChildCount()-2 -- TODO: HACK
+    local i = 0
+    while i < numChildren do
+        local hint = hints:getChild("orxonox/QuestGUI/Quest/Hints/" .. i)
+        if hint ~= nil then
+            hints:removeChildWindow(hint)
+            winMgr:destroyWindow(hint)
+        end
+        i = i+1
+    end
+    hints:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
+
+    P.currentQuest = nil
+end
+
+-- Clear the quests list
+function P.clearQuestList()
+    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    list:resetList()
+    P.quests = {}
+end
+
+-- Select an input quest in the input list.
+-- list is the list in which the input quest is to be selected.
+-- quest is the quest to be selected.
+function P.selectQuest(list, quest)
+    if quest == nil then -- If the input quest is nil, there is nothing to be selected, an error is output and the first quest is selected instead.
+        cout(1, "Error in QuestGUI: selectQuest(), input quest is nil. Selecting first.")
+        list:setItemSelectState(list:getListboxItemFromIndex(0), true) -- Select first
+        return
+    end
+
+    local questId = P.questManager:getId(quest)
+    local found = false
+    local index = 0
+    -- Iterate over all quests currently in the list.
+    for k,v in pairs(P.quests) do
+        -- If the id's are the same we have found the quest.
+        if P.questManager:getId(v) == questId then
+            found = true
+            index = k-1
+        end
+    end
+
+    if found then -- If the quest was found it is selected.
+        list:setItemSelectState(list:getListboxItemFromIndex(index), true)
+    else -- If the quest isn't found an error is output and the first quest is selected instead.
+        cout(1, "Error in QuestGUI: selectQuest(), input quest is not in list. Selecting first.")
+        list:setItemSelectState(list:getListboxItemFromIndex(0), true) -- Select first
+    end
+end
+
+-- Helper function, insert the input hint into the input hintsWindow. Returns the height of the newly inserted hint.
+-- hintsWindow is the window in which the hint is to be inserted.
+-- hint is the hint to be inserted.
+-- index is the index of the hint.
+-- offset is the current offset in the hintsWindow.
+function P.insertHint(hintsWindow, hint, index, offset)
+    -- Create the window for the hint.
+    local window = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/QuestGUI/Quest/Hints/" .. index)
+    window:setProperty("HorzFormatting", "WordWrapLeftAligned")
+    window:setProperty("VertFormatting", "TopAligned")
+    window:setProperty("FrameEnabled", "false")
+    window:setID(index)
+    hintsWindow:addChildWindow(window)
+    local description = P.questManager:getDescription(hint)
+    window:setText(description:getDescription())
+    window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
+    local height = getStaticTextWindowHeight(window)
+    window:setHeight(CEGUI.UDim(0, height))
+    window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
+    return height
+end
+
+-- Show the currently active quests in the quests list.
+function P.showActiveQuestsButton_clicked(e)
+    if P.showActive == false then
+        P.showActive = true
+        P.loadQuestsList()
+    end
+end
+
+-- Show the finished (i.e. inactive) quests in the quests list.
+function P.showFinishedQuestsButton_clicked(e)
+    if P.showActive == true then
+        P.showActive = false
+        P.loadQuestsList()
+    end
+end
+
+-- Change to a new quest.
+function P.changeQuest_clicked(e)
+    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local choice = list:getFirstSelectedItem()
+    if choice ~= nil then
+        local index = list:getItemIndex(choice)
+        local quest = P.quests[index+1]
+        if quest ~= nil then
+            P.loadQuest(quest)
+        end
+    end
+end
+
+-- Change to a new subquest.
+function P.changeToSubquest_clicked(e)
+    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
+    local questsList = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local choice = list:getFirstSelectedItem()
+    if choice ~= nil then
+        local index = list:getItemIndex(choice)
+        local quest = P.subquests[index+1]
+        if quest ~= nil then
+            -- If the P.showActive must be changed to display the quest the quests list also has to be regenerated.
+            if quest:isActive(P.player) == P.showActive then
+                P.selectQuest(questsList, quest)
+            else
+                P.showActive = quest:isActive(P.player)
+                P.loadQuestsList(quest)
+            end
+        else
+            cout(1, "Error in QuestGUI: changeToSubquest(), quest was nil. Ignoring...")
+        end
+    end
+end
+
+-- old:
+--[[
 function P.createQuestGUI()
     local questManager = orxonox.QuestManager:getInstance()
@@ -283,5 +573,5 @@
     winMgr:destroyWindow(P.detailsWindows[detailsNr])
     P.detailsWindows[detailsNr] = nil
-end
+end --]]
 
 return P
Index: code/branches/tutoriallevel2/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/tutoriallevel2/data/gui/scripts/SingleplayerMenu.lua	(revision 8369)
+++ code/branches/tutoriallevel2/data/gui/scripts/SingleplayerMenu.lua	(revision 8371)
@@ -54,4 +54,5 @@
         index = index + 1
     end
+
     for k,v in pairs(P.levelList) do
         local item = CEGUI.createListboxTextItem(v:getName())
Index: code/branches/tutoriallevel2/data/levels/quests.oxw
===================================================================
--- code/branches/tutoriallevel2/data/levels/quests.oxw	(revision 8371)
+++ code/branches/tutoriallevel2/data/levels/quests.oxw	(revision 8371)
@@ -0,0 +1,231 @@
+<LevelInfo
+ name = "Quests showcase"
+ description = "Level to test and showcase quests."
+ tags = "test, showcase"
+/>
+
+<?lua
+  include("HUDTemplates3.oxo")
+  include("stats.oxo")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/lodInformation.oxt")
+?>
+
+<Level
+ name         = "Questsystem"
+ description  = "Just a few tests"
+>
+    <templates>
+        <Template link=lodtemplate_default />
+    </templates>
+
+    <Scene
+        ambientlight = "0.5, 0.5, 0.5"
+        skybox       = "Orxonox/Starbox"
+    >
+
+        <Script code="showGUI NotificationLayer false true" needsGraphics="true" />
+
+        <GlobalQuest id="quest0">
+            <QuestDescription title="Quest 0" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+            Ut consequat leo ut quam congue semper et eget nibh. Nunc sit amet velit eu lorem pretium adipiscing eu ut ante. Nulla facilisi. Pellentesque interdum, neque nec consectetur vulputate, mauris risus feugiat nunc, ac sollicitudin neque quam ut tellus. Morbi elit velit, tincidunt et hendrerit eget, rutrum at erat. Duis eros nulla, faucibus vitae blandit vitae, pharetra sollicitudin justo." failMessage="Fail message 0" completeMessage="Complete message 0" />
+        </GlobalQuest>
+        <GlobalQuest id="quest1">
+            <QuestDescription title="Quest 1" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor." failMessage="Fail message 1" completeMessage="Complete message 1" />
+            <hints>
+                <QuestHint id="quest1hint1">
+                    <QuestDescription title="The super Hint." description="Be proud of yourself." />
+                </QuestHint>
+                <QuestHint id="quest1hint2">
+                    <QuestDescription title="The super Hint2." description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor." />
+                </QuestHint>
+                <QuestHint id="quest1hint3">
+                    <QuestDescription title="The super Hint3." description="Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus." />
+                </QuestHint>
+            </hints>
+            <subquests>
+                <GlobalQuest id="quest1.1">
+                    <QuestDescription title="Quest 1: Subquest 1" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam." failMessage="Fail message 2" completeMessage="Complete message 2" />
+                </GlobalQuest>
+                <GlobalQuest id="quest1.2">
+                    <QuestDescription title="Quest 1: Subquest 2" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor." failMessage="Fail message 2" completeMessage="Complete message 2" />
+                </GlobalQuest>
+                <GlobalQuest id="quest1.3">
+                    <QuestDescription title="Quest 1: Subquest 3" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas." failMessage="Fail message 2" completeMessage="Complete message 2" />
+                </GlobalQuest>
+                <GlobalQuest id="quest1.4">
+                    <QuestDescription title="Quest 1: Subquest 4" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit." failMessage="Fail message 2" completeMessage="Complete message 2" />
+                </GlobalQuest>
+                <GlobalQuest id="quest1.5">
+                    <QuestDescription title="Quest 1: Subquest 5" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam." failMessage="Fail message 2" completeMessage="Complete message 2" />
+                </GlobalQuest>
+            </subquests>
+        </GlobalQuest>
+        <GlobalQuest id="quest2">
+            <QuestDescription title="Quest 2" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac." failMessage="Fail message 2" completeMessage="Complete message 2" />
+        </GlobalQuest>
+        <GlobalQuest id="quest3">
+            <QuestDescription title="Quest 3" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit." failMessage="Fail message 1" completeMessage="Complete message 1" />
+        </GlobalQuest>
+        <GlobalQuest id="quest4">
+            <QuestDescription title="Quest 4" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+            Ut consequat leo ut quam congue semper et eget nibh. Nunc sit amet velit eu lorem pretium adipiscing eu ut ante. Nulla facilisi. Pellentesque interdum, neque nec consectetur vulputate, mauris risus feugiat nunc, ac sollicitudin neque quam ut tellus. Morbi elit velit, tincidunt et hendrerit eget, rutrum at erat. Duis eros nulla, faucibus vitae blandit vitae, pharetra sollicitudin justo. Donec luctus est a tortor auctor feugiat." failMessage="Fail message 1" completeMessage="Complete message 1" />
+        </GlobalQuest>
+        <GlobalQuest id="quest5">
+            <QuestDescription title="Quest 5" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa." failMessage="Fail message 1" completeMessage="Complete message 1" />
+        </GlobalQuest>
+        <GlobalQuest id="quest6">
+            <QuestDescription title="Quest 6" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. " failMessage="Fail message 1" completeMessage="Complete message 1" />
+        </GlobalQuest>
+
+        <EventMultiTrigger name=spawntrigger>
+            <events>
+                <trigger>
+                    <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+                </trigger>
+            </events>
+        </EventMultiTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <AddQuest questId="quest0" />
+                <AddQuest questId="quest1" />
+                <AddQuest questId="quest1.1" />
+                <AddQuest questId="quest1.2" />
+                <AddQuest questId="quest1.3" />
+                <AddQuest questId="quest1.4" />
+                <AddQuest questId="quest1.5" />
+                <AddQuest questId="quest2" />
+                <AddQuest questId="quest3" />
+                <AddQuest questId="quest4" />
+                <AddQuest questId="quest5" />
+                <AddQuest questId="quest6" />
+                <AddQuestHint hintId ="quest1hint1" />
+                <AddQuestHint hintId ="quest1hint2" />
+                <AddQuestHint hintId ="quest1hint3" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=spawntrigger />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon position="-100,0,0" times=1>
+            <effects>
+                <FailQuest questId="quest1.1" />
+                <FailQuest questId="quest1.2" />
+                <FailQuest questId="quest1.3" />
+                <FailQuest questId="quest1.4" />
+                <FailQuest questId="quest1.5" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=dtrigger1 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="1.0,0,0" material="Examples/Flare" />
+                <DistanceTrigger name=dtrigger1 position="0,0,0" distance=10 target="Pawn" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon position="100,0,0" times=-1>
+            <effects>
+                <CompleteQuest questId="quest0" />
+                <CompleteQuest questId="quest1" />
+                <CompleteQuest questId="quest1.1" />
+                <CompleteQuest questId="quest1.2" />
+                <CompleteQuest questId="quest1.3" />
+                <CompleteQuest questId="quest1.4" />
+                <CompleteQuest questId="quest1.5" />
+                <CompleteQuest questId="quest2" />
+                <CompleteQuest questId="quest3" />
+                <CompleteQuest questId="quest4" />
+                <CompleteQuest questId="quest5" />
+                <CompleteQuest questId="quest6" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=dtrigger2 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="0,1.0,0" material="Examples/Flare" />
+                <DistanceTrigger name=dtrigger2 position="0,0,0" distance=10 target="Pawn" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <!--QuestEffectBeacon position="0,0,100" times=-1>
+            <effects>
+                <AddQuest questId="b80c2c60-e62c-4637-80f8-5aa18dc93b34" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=qebdt1 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="1.0,1.0,1.0" material="Examples/Flare" />
+                <DistanceTrigger name=qebdt1 position="0,0,0" distance=10 target="ControllableEntity" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon position="-100,0,0" times=-1>
+            <effects>
+                <FailQuest questId="b80c2c60-e62c-4637-80f8-5aa18dc93b34" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=qebdt2 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="1.0,0,0" material="Examples/Flare" />
+                <DistanceTrigger name=qebdt2 position="0,0,0" distance=10 target="ControllableEntity" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon position="100,0,0" times=-1>
+            <effects>
+                <CompleteQuest questId="b80c2c60-e62c-4637-80f8-5aa18dc93b34" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=qebdt3 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="0,1.0,0" material="Examples/Flare" />
+                <DistanceTrigger name=qebdt3 position="0,0,0" distance=10 target="ControllableEntity" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon position="0,100,0" times=-1>
+            <effects>
+                <AddQuestHint hintId="022a859d-08dd-4eac-a085-c28c29c06d48" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=qebdt4 />
+                </execute>
+            </events>
+            <attached>
+                <Billboard position="0,0,0" colour="0,0,1.0" material="Examples/Flare" />
+                <DistanceTrigger name=qebdt4 position="0,0,0" distance=10 target="ControllableEntity" />
+            </attached>
+        </QuestEffectBeacon>
+
+        <ParticleEmitter name=firecenter position="0,0,0" source="Orxonox/fire3" active=false>
+            <events>
+                <activity>
+                    <QuestListener questId="b80c2c60-e62c-4637-80f8-5aa18dc93b34" mode="complete" />
+                </activity>
+            </events>
+        </ParticleEmitter-->
+
+    </Scene>
+</Level>
+
Index: code/branches/tutoriallevel2/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/tutoriallevel2/src/libraries/core/GUIManager.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/libraries/core/GUIManager.cc	(revision 8371)
@@ -37,4 +37,5 @@
 #include <CEGUIDefaultLogger.h>
 #include <CEGUIExceptions.h>
+#include <CEGUIFontManager.h>
 #include <CEGUIInputEvent.h>
 #include <CEGUIMouseCursor.h>
@@ -43,4 +44,5 @@
 #include <CEGUIWindow.h>
 #include <CEGUIWindowManager.h>
+#include <CEGUIXMLAttributes.h>
 #include <elements/CEGUIListbox.h>
 #include <elements/CEGUIListboxItem.h>
@@ -649,3 +651,38 @@
     }
 
+    /**
+    @brief
+        Adds a new freetype font to the CEGUI system.
+    @param name
+        The name of the new font.
+    @param size
+        The font size of the new font in pixels.
+        @param fontName
+        The filename of the font.
+    */
+    /*static*/ void GUIManager::addFontHelper(const std::string& name, int size, const std::string& fontName)
+    {
+        if(CEGUI::FontManager::getSingleton().isFontPresent(name)) // If a font with that name already exists.
+            return;
+
+        CEGUI::Font* font = NULL;
+        CEGUI::XMLAttributes xmlAttributes;
+
+        // Attributes specified within CEGUIFont
+        xmlAttributes.add("Name", name);
+        xmlAttributes.add("Filename", fontName);
+        xmlAttributes.add("ResourceGroup", "");
+        xmlAttributes.add("AutoScaled", "true");
+        xmlAttributes.add("NativeHorzRes", "800");
+        xmlAttributes.add("NativeVertRes", "600");
+
+        // Attributes specified within CEGUIXMLAttributes
+        xmlAttributes.add("Size", multi_cast<std::string>(size));
+        xmlAttributes.add("AntiAlias", "true");
+
+        font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes);
+        if(font != NULL)
+            font->load();
+    }
+
 }
Index: code/branches/tutoriallevel2/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/tutoriallevel2/src/libraries/core/GUIManager.h	(revision 8369)
+++ code/branches/tutoriallevel2/src/libraries/core/GUIManager.h	(revision 8371)
@@ -125,7 +125,8 @@
 
         // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work
-        static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export
-        static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); //tolua_export
-        static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export
+        static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); // tolua_export
+        static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); // tolua_export
+        static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); // tolua_export
+        static void addFontHelper(const std::string& name, int size, const std::string& fontName); // tolua_export
 
         static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
Index: code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc	(revision 8371)
@@ -40,4 +40,5 @@
 #include "network/Host.h"
 #include "network/NetworkFunction.h"
+#include "util/Convert.h"
 #include "util/ScopedSingletonManager.h"
 
@@ -342,4 +343,36 @@
     /**
     @brief
+        Fetches the newest Notifications for a specific NotificationListener and stores them in the input map.
+    @param listener
+        The NotificationListener the Notifications are fetched for.
+    @param map
+        A pointer to a multimap, in which the notifications are stored. The map needs to have been allocated.
+    @param numberOfNotifications
+        The number of newest Notifications to be got.
+    @return
+        Returns true if successful.
+    */
+    void NotificationManager::getNewestNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications)
+    {
+        assert(listener);
+        assert(map);
+
+        std::multimap<std::time_t, Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; // All the Notifications for the input NotificationListener.
+
+        if(!notifications->empty()) // If the list of Notifications is not empty.
+        {
+            std::multimap<std::time_t,Notification*>::iterator it = notifications->end();
+            for(int i = 0; i < numberOfNotifications; i++) // Iterate through the Notifications from the newest until we have the specified number of notifications.
+            {
+                it--;
+                map->insert(std::pair<std::time_t, Notification*>(it->first, it->second)); // Add the found Notifications to the map.
+                if(it == notifications->begin())
+                    break;
+            }
+        }
+    }
+
+    /**
+    @brief
         Enters the edit mode of the NotificationLayer.
     */
@@ -387,5 +420,12 @@
     void NotificationManager::loadQueues(void)
     {
-        new NotificationQueue("all");
+        NotificationQueue* allQueue = new NotificationQueue("all");
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.resizeQueue(\"all\", 0.5, 0, " + multi_cast<std::string>(allQueue->getMaxSize()) + ")");
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.moveQueue(\"all\", 0, 10, 0.3, 0)");
+
+        NotificationQueue* infoQueue = new NotificationQueue("info", NotificationManager::ALL, 1, -1);
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueFont(\"info\", 24, \"FFFFFF00\")");
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.resizeQueue(\"info\", 0.6, 0, " + multi_cast<std::string>(infoQueue->getMaxSize()) + ")");
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.moveQueue(\"info\", 0.2, 0, 0.8, 0)");
     }
 
Index: code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h	(revision 8371)
@@ -98,4 +98,6 @@
                 { this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
 
+            void getNewestNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications); //!< Fetches the newest Notifications for a specific NotificationListener and stores them in the input map.
+
             void enterEditMode(void); //!< Enters the edit mode of the NotificationLayer.
 
Index: code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc	(revision 8371)
@@ -161,5 +161,5 @@
     {
         this->tickTime_ += dt; // Add the time interval that has passed to the time counter.
-        if(this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
+        if(this->displayTime_ != INF && this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
         {
             this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containig the current time.
@@ -188,5 +188,8 @@
         std::multimap<std::time_t, Notification*>* notifications = new std::multimap<std::time_t, Notification*>;
         // Get the Notifications sent in the interval from now to now minus the display time.
-        NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
+        if(this->displayTime_ == INF)
+            NotificationManager::getInstance().getNewestNotifications(this, notifications, this->getMaxSize());
+        else
+            NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
 
         if(!notifications->empty())
@@ -364,9 +367,7 @@
         Sets the maximum number of seconds a Notification is displayed.
     @param time
-        The number of seconds the Notifications is displayed.
-    @return
-        Returns true if successful.
-    */
-    void NotificationQueue::setDisplayTime(unsigned int time)
+        The number of seconds a Notification is displayed.
+    */
+    void NotificationQueue::setDisplayTime(int time)
     {
         if(this->displayTime_ == time)
Index: code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.h	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.h	(revision 8371)
@@ -121,10 +121,10 @@
                 { return this->maxSize_; }
 
-            void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
+            void setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed.
             /**
             @brief Returns the time interval the Notification is displayed.
             @return Returns the display time.
             */
-            inline unsigned int getDisplayTime() const
+            inline int getDisplayTime() const
                 { return this->displayTime_; }
             // tolua_end
@@ -152,4 +152,5 @@
             static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
             static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
+            static const int INF = -1; //!< Constant denoting infinity.
 
             std::string name_; //!< The name of the NotificationQueue.
@@ -157,5 +158,5 @@
             unsigned int maxSize_; //!< The maximal number of Notifications displayed.
             unsigned int size_; //!< The number of Notifications displayed.
-            unsigned int displayTime_; //!< The time a Notification is displayed.
+            int displayTime_; //!< The time a Notification is displayed.
 
             bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.
Index: code/branches/tutoriallevel2/src/modules/objects/triggers/MultiTrigger.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/objects/triggers/MultiTrigger.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/objects/triggers/MultiTrigger.cc	(revision 8371)
@@ -198,5 +198,4 @@
                         if(bActive ^ this->isActive(state->originator))
                         {
-
                             bool bFire = true;
 
Index: code/branches/tutoriallevel2/src/modules/objects/triggers/TriggerBase.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/objects/triggers/TriggerBase.h	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/objects/triggers/TriggerBase.h	(revision 8371)
@@ -133,4 +133,10 @@
             inline int getActivations(void) const
                 { return this->remainingActivations_; }
+            /**
+            @brief Check whether the trigger has still at least one remaining activation.
+            @return Returns true if the trigger has remaining activations (i.e. the number of remaining activations is not zero).
+            */
+            inline bool hasRemainingActivations(void) const
+                { return this->remainingActivations_ > 0 || this->remainingActivations_ == INF_s; }
 
             /**
Index: code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.cc	(revision 8371)
@@ -274,4 +274,7 @@
     int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
     {
+        if(quest == NULL)
+            return this->getNumRootQuests(player);
+
         std::list<Quest*> quests = quest->getSubQuestList();
         int numQuests = 0;
@@ -296,4 +299,7 @@
     Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
     {
+        if(quest == NULL)
+            return this->getRootQuest(player, index);
+
         std::list<Quest*> quests = quest->getSubQuestList();
         for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
@@ -349,4 +355,17 @@
     /**
     @brief
+        Get the parent-quest of the input Quest for the input player.
+    @param quest
+        The Quest to get the parent-quest of.
+    @param player
+        The player.
+    */
+    Quest* QuestManager::getParentQuest(Quest* quest)
+    {
+        return quest->getParentQuest();
+    }
+
+    /**
+    @brief
         Get the QuestDescription of the input Quest.
     @param item
@@ -375,4 +394,30 @@
     /**
     @brief
+        Get the id of the input Quest.
+    @param item
+        The Quest to get the id of.
+    @return
+        Returns the id of the input Quest.
+    */
+    const std::string QuestManager::getId(Quest* item) const
+    {
+        return item->getId();
+    }
+
+    /**
+    @brief
+        Get the id of the input QuestHint.
+    @param item
+        The QuestHint to get the id of.
+    @return
+        Returns the id of the input QuestHint.
+    */
+    const std::string QuestManager::getId(QuestHint* item) const
+    {
+        return item->getId();
+    }
+
+    /**
+    @brief
         Retrieve the player for a certain GUI.
     @param guiName
Index: code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.h	(revision 8369)
+++ code/branches/tutoriallevel2/src/modules/questsystem/QuestManager.h	(revision 8371)
@@ -81,6 +81,11 @@
             QuestHint* getHints(Quest* quest, orxonox::PlayerInfo* player, int index); //!< Get the index-th QuestHint of the input Quest for the input player.
 
-            QuestDescription* getDescription(Quest* item);
-            QuestDescription* getDescription(QuestHint* item);
+            Quest* getParentQuest(Quest* quest); //!< Get the parent-quest of the input Quest.
+
+            QuestDescription* getDescription(Quest* item); //!< Get the QuestDescription of the input Quest.
+            QuestDescription* getDescription(QuestHint* item); //!< Get the QuestDescription of the input QuestHint.
+
+            const std::string getId(Quest* item) const; //!< Get the id of the input Quest.
+            const std::string getId(QuestHint* item) const; //!< Get the id of the input QuestHint.
             // tolua_end
 
Index: code/branches/tutoriallevel2/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/tutoriallevel2/src/orxonox/LevelManager.cc	(revision 8369)
+++ code/branches/tutoriallevel2/src/orxonox/LevelManager.cc	(revision 8371)
@@ -222,4 +222,5 @@
                 this->nextLevel_ = this->availableLevels_.begin();
             }
+
             while(this->nextIndex_ != index)
             {
