   puzzle_finished: () ->
     @puzzle.puzzle_view.draw_photo()
     @finished = true
+    @prompt_for_new_puzzle()
 
 
 



  write_message: (n) ->
    @canvas = document.getElementById("puzzle-widget")
    @context = @canvas.getContext('2d')
    @context.fillStyle = "#999999"
    @context.fillRect(100,0,115+17*(16-n),30)
    @context.fillStyle = "#333333"
    @context.font = "bold 14px sans-serif"
    @context.textAlign = "left"
    @context.textbaseline = "top"
    if n == 1
      msg = "1 piece left"
      cx = 374



  start_indicator: () ->
    @clear_indicator
    canvas = document.getElementById("puzzle-widget")
    context = canvas.getContext('2d')
    for p in [16..1]
      context.fillStyle = @puzzle.colors.rotation[16-p]
      xp = 489-17*p
      yp = 6
      context.beginPath()
      context.moveTo(xp+5,yp)
      context.lineTo(xp+12,yp)
      context.lineTo(xp+12,yp+17)
      context.lineTo(xp+5,yp+17)
      context.lineTo(xp,yp+8)
      context.lineTo(xp+5,yp)
      context.fill()
      context.closePath()
    @write_message(16)


  clear_indicator: ->
    canvas = document.getElementById("puzzle-widget")
    context = canvas.getContext('2d')
    context.fillStyle = '#999999'
    context.fillRect(100,0,385,30)


  new_puzzle_prompt: ->
    @clear_indicator()
    canvas = document.getElementById("puzzle-widget")
    context = canvas.getContext('2d')
    context.fillStyle = "#cc3333"
    context.font = "bold 14px sans-serif"
    context.textAlign = "left"
    context.textbaseline = "top"
    context.fillText("Click for new puzzle",240,20)


  decrement: () ->
