 
 hideAlert = ->
   $('#alert').addClass('hidden')
+  $('#alert')
+    .removeClass('alert-success')
+    .removeClass('alert-info')
+    .removeClass('alert-warning')
+    .removeClass('alert-danger')
 
 
 showAlert = (type, reason, message) ->

    unless failedWeeksArray.length > 0
      navbarCollapsedState('add')
  .catch (err) ->
    # Failed to get user info or there were server-side errors while getting
    # weekly charts.
    message = err.responseJSON?.error ? ''
    if message.indexOf('error code 6') > -1
      # No user with that name was found.
      $username = $('#username')
      $username.parent().addClass('has-error').addClass('has-feedback')

  new Promise (resolve, reject) ->
    $.getJSON(url, params)
    .done (result) -> resolve(result)
    .fail (jqxhr, textStatus, reason) ->
      message = jqxhr.responseJSON?.error ? reason
      error = new Error(message)
      error.jqxhr = jqxhr
      error.textStatus = textStatus
      error.reason = reason
      reject(error)


setDefaults = (params) ->
