 
 
 window.Earl =
+  seek_to_hash: false 
 
   # Updating the browser window location. 
   load_page: (url, query_params) ->

    # enough to deal with the mightly Webkit browser's imposition of 
    # a remembered scroll position for a return visitor upon initial 
    # page load!
    if seek_to_hash 
      seek_to_hash = false
      el = document.querySelector("##{loc.hash}")
      if el
        $(window).scrollTop getCoords(el).top - 50
  monitor()

seek_to_hash = false 

url_from_browser_location = -> 
  # location.search returns the query parameters

onload = -> 

  Earl.root = get_script_attr('earl', 'root') or '/'
  if Earl.root == true # earl attribute just set with no value
    Earl.root = '/'

  if window.location.pathname.match('.html')
    Earl.root += location.pathname.match(/\/([\w-_]+\.html)/)[1] + '/'
  if Earl.root[0] != '/'
