     $("#{id} .info-hp").html("")
     $("#{id} .other-info").html("")
 
-
 highlightPath = (path) ->
   for qr in path
     $("#tile-#{qr[0]}-#{qr[1]}").addClass("path")

  
setupUnits = ->
  $("#board").addClass("battle-start")
  $(".tile").html("").removeClass("path current enemy")
  clearUnitInfoBoxes()
  for id, unit of window.BattleLog.participants
    unit.currentHP = unit.hp
    tile = getTile(unit.spawn_point)
    tile.html("<span class='unit-icon team-#{unit.team}-unit'></span>")
    unit.location = unit.spawn_point

pauseReplay = ->

    window.iid = window.setInterval(nextTick, window.replaySpeed)
  false

$(".tile").click( ->
  id = $(this).data("unitId")
  showDetails(id) if id?
)

showDetails = (id) ->
  $(".current").removeClass("current")
  $(".target").removeClass("target")
  $(".path").removeClass("path")
  $(".enemy").removeClass("enemy")
  $(".hit").removeClass("hit")
  unit = getUnit(id)
  qr = unit.location
  $("#tile-#{qr[0]}-#{qr[1]}").addClass("current")

  clearUnitInfoBoxes()
  updateUnitInfoBox(unit, true)
  if unit.target?
    target = getUnit(unit.target)
    qr = target.location
    $("#tile-#{qr[0]}-#{qr[1]}").addClass("enemy")
    updateUnitInfoBox(target, false)
  
