 # Update the notification section of the options page with the current
 # settings.
 loadNotifications = ->
-  if store.get 'notifications'
+  if store.get 'notifications.enabled'
     $('#notifications').attr 'checked', 'checked'
   else
     $('#notifications').removeAttr 'checked'
-  notificationDuration = store.get 'notificationDuration'
+  notificationDuration = store.get 'notifications.duration'
   timeInSecs = 0
   timeInSecs = notificationDuration * .001 if notificationDuration > timeInSecs
   $('#notificationDuration').val timeInSecs

# Update the toolbar behaviour section of the options page with the current
# settings.
loadToolbar = ->
  $('input[name="toolbar_behaviour"]').each ->
    $this = $ this
    $this.attr 'checked', 'checked' if store.get $this.attr 'id'
    yes
  if store.get 'toolbarPopupClose'
    $('#toolbarPopupClose').attr 'checked', 'checked'
  else
    $('#toolbarPopupClose').removeAttr 'checked'
  if store.get 'toolbarTemplateDetails'
    $('#toolbarTemplateDetails').attr 'checked', 'checked'
  else
    $('#toolbarTemplateDetails').removeAttr 'checked'
  updateToolbarTemplates()
  loadToolbarControlEvents()

# Bind the event handlers required for controlling toolbar behaviour changes.
loadToolbarControlEvents = ->
  radios         = $ 'input[name="toolbar_behaviour"]'
  popupFields    = $ '#toolbarPopupClose'
  popupMisc      = $ '#toolbarPopupClose_txt'
  templateFields = $ '#toolbarTemplateName, #toolbarTemplateDetails'
  templateMisc   = $ '#toolbarTemplateName_txt, #toolbarTemplateDetails_txt'
  # Extract help images for both groups.
  popupFields.each ->
    popupMisc = popupMisc.add $(this).parents('div').first().find 'img'

      enabled:  option.data('enabled') is 'true'
      image:    option.data 'image'
      index:    option.parent().find('option').index option
      key:      option.val()
      readOnly: option.data('readOnly') is 'true'
      shortcut: option.data 'shortcut'
      title:    option.text()
