 
           window.location.pathname = firstRoute or "/"
 
-
-
   setVisitor:(visitor)-> @visitor = visitor
   getVisitor: -> @visitor
   getAccount: -> KD.whoami()


  doLogout:->
    KD.logout()
    KD.remote.api.JUser.logout (err, account, replacementToken)=>
      @_logoutAnimation()
      KD.utils.wait 1000, ->
        $.cookie 'clientId', replacementToken  if replacementToken
        localStorage.loggingOut = '1'
        location.reload()

  _logoutAnimation:->

  isUserLoggedIn: -> KD.isLoggedIn()

  isLoggingIn: (isLoggingIn) ->

    storage = new LocalStorage 'Koding'
    if storage.getValue('loggingOut') is '1'
      storage.unsetKey 'loggingOut'
      return yes
    if isLoggingIn?
      @_isLoggingIn = isLoggingIn
    else
      @_isLoggingIn ? no

  showInstructionsBook:->
    if $.cookie 'newRegister'
