   window_size = @image_window_size
   ratio = 1.0
   if !@viewing_larger_version
-
-    ### Zoom the image to fit the viewport. ###
-
+    # Zoom the image to fit the viewport.
     ratio = window_size.width / original_width
     if original_height * ratio > window_size.height
       ratio = window_size.height / original_height

    post_frame: post_frame
  @set_post_info()

  ### Hide the editor when changing posts. ###

  @edit_show false
  return

### Return the frame spec for the hash, eg. "-0".
#
# If the post has no frames, then just omit the frame spec.  If the post has any frames,
# then return the frame number or "-F" for the full image. 
###

BrowserView::post_frame_hash = (post, post_frame) ->
  if post.frames.length == 0
    return ''
  '-' + (if post_frame == -1 then 'F' else post_frame)

### Return the default frame to display for the given post.  If the post isn't loaded,
# we don't know which frame we'll display and null will be returned.  This corresponds
# to a hash of #1234, where no frame is specified (eg. #1234-F, #1234-0). 
###

BrowserView::get_default_post_frame = (post_id) ->
  post = Post.posts.get(post_id)
  if post == null or post == undefined
    return null
  if post.frames.length > 0 then 0 else -1

BrowserView::get_post_frame_hash = (post, post_frame) ->

  ###
  # Omitting the frame in the hash selects the default frame: the first frame if any,
  # otherwise the full image.  If we're setting the hash to a post_frame which would be

#   don't pull an out-of-date page next time.  This is slower, and would require us
#   to be careful about expiring the cache.
###
window.BrowserView = (container) ->
  @container = container

  # The post that we currently want to display.  This will be either one of the
  # current html_preloads, or be the displayed_post_id. 
  @wanted_post_id = null
  @wanted_post_frame = null

  # The post that's currently actually being displayed.
  @displayed_post_id = null
  @displayed_post_frame = null
  @current_ajax_request = null
