 
     $navbar = $("#main-nav")
     $navbar.find(".active").removeClass("active")
+    
+    if url == "/"
+      url = "/me"
+
     if url
-      $navbar.find("a[href=\"#{url}\"]").closest("li").addClass("active")
-
+      $navbar.find("a[href^=\"#{url}\"]").closest("li").addClass("active")
+
+    return
+
+
+  changeNavbarDate : (date) ->
+
+    $navbarItems = $("#main-nav li").slice(0, 3)
+    $navbarItems.each(->
+      $a = $(this).find("a")
+      newHref = $a.attr("href").replace(/^(\/[a-z]+)(.*)$/, (full, match1, part2) ->
+        if date?
+          "#{match1}/#{date}"
+        else
+          match1
+      )
+      $a.attr("href", newHref)
+    )
     return
 
 

    logTimeModel = new LogTimeModel()
    @changeView(new LogTimeLocalView(model : logTimeModel))
    @changeActiveNavbarItem("/log")
    @changeTitle("Log time")



    teamModel = new TeamViewModel(date : date)
    @showReport(teamModel)
    @changeActiveNavbarItem("/team")
    @changeNavbarDate(date)
    @changeTitle("Team")


