       T.log "status: " + astatus
       T.log "error: " + error
     handled
-  
+
   hello = ->
     $.ajax
       url: "/ajax/hello"

        data:
          akey: tupelo.player.akey
          game_id: game_id
  
        success: gameCreateOk
        error: ajaxErr
  
    if tupelo.game_id?
      $("button.game_join").attr "disabled", true
      $("tr#game_id_" + tupelo.game_id).addClass "highlight"
    else
      $("button#" + id).attr "disabled", true for id in disabledIds
      $("button.game_join").click gameJoinClicked
  
  listGamesOk = (result) ->
    #T.log "listGamesOk"
    #T.log result
    html = ""
    disabledIds = []
    for own game_id of result
      html += "<tr id=\"game_id_" + game_id + "\">"
      #players = []
      #for res in result[game_id]
      #  plr = new T.Player().fromObj res
      #  players.push plr.player_name
      players = (new T.Player().fromObj(res).player_name for res in result[game_id])
  
      html += "<td>" + escapeHtml(players.join(", ")) + "</td>"
      html += "<td class=\"game_list_actions\"><button class=\"game_join btn\" id=\"game_join_" + game_id + "\"><span><span>join</span></span></button></td>"
      html += "</tr>"
      disabledIds.push "game_join_" + game_id if players.length is 4
  
    $("#game_list table tbody").html html
    updateGameLinks disabledIds
    dbg()
  
  listPlayersOk = (result) ->
    T.log result
    html = ""

  updateHand = (newHand) ->
    html = ""
    hand = []
    for item, i in newHand
      card = new T.Card(item.suit, item.value)
      hand.push card
      html += "<a class=\"selectable\" href=\"#\">" if tupelo.my_turn
      html += "<span class=\"card\" id=\"card_#{i}\">" + card.toShortHtml() + "</span>"
      html += "</a>" if tupelo.my_turn

    tupelo.hand = hand
