   ###
   changeToContext: (contextId, onChange, mouse) ->
     if(@contextChangeCallback?) then @contextChangeCallback()
-    $("#container").unbind("click")
-    if(mouse) then $("#container").bind("click", mouse)
+    $(document).unbind("click")
+    if(mouse?) then $(document).bind("click", mouse)
     if(onChange?) then @contextChangeCallback = onChange
     @currentContext = contextId
 

    else
      $('#answer-submit-btn').hide()
      $('#unallocated li').bind 'click', (event) ->
        thisReference.allocMenuContext(this)

    $('#answer-add-dice-btn').unbind('click')


  ### Allocation menu context ###
  allocMenuContext: (element) ->
    if(Game.isMyTurn())
      thisReference = this
      $('#unallocated li').unbind('click')
      $('#unallocated li').bind 'click', (event) ->
        thisReference.allocMenuContext(this)
        event.stopPropagation()

      # If the user clicks outside the menu then close it
      exitMenuHandler  = (e) -> 
        menu = $("#move-allocation-menu")
        position = $(menu).position()
        height = $(menu).height()
        width = $(menu).width()
        mouseXisInside = (e.clientX > position.left and e.clientX < position.left + width)
        mouseYisInside = (e.clientY > position.top and e.clientY < position.left + height)
        #if(!mouseXisInside || !mouseYisInside) then thisReference.changeToContext(thisReference.Contexts.Neutral)
        thisReference.changeToContext(thisReference.Contexts.Neutral)
      # Change the context to say the menu is now open
      @changeToContext(@Contexts.AllocMenu, @allocMenuContextChange, exitMenuHandler)
      @drawAllocationMoveMenu(element)
     





