public function BuildProfile() {
      if (!is_object($this->User))
         throw new Exception(T('Cannot build profile information if user is not defined.'));
      
      $Session = Gdn::Session();
      if (strpos($this->CssClass, 'Profile') === FALSE)
         $this->CssClass .= ' Profile';
      $this->Title(Gdn_Format::Text($this->User->Name));
      
      if ($this->_DeliveryType != DELIVERY_TYPE_VIEW) {
         // Javascript needed
         $this->AddJsFile('jquery.jcrop.pack.js');
         $this->AddJsFile('profile.js');
         $this->AddJsFile('jquery.gardenmorepager.js');
         $this->AddJsFile('activity.js');
         
         // Build activity URL
         $ActivityUrl = 'profile/activity/';
         if ($this->User->UserID != $Session->UserID)
            $ActivityUrl = UserUrl($this->User, '', 'activity');
         
         // Show activity?
         if (C('Garden.Profile.ShowActivities', TRUE))
            $this->AddProfileTab(T('Activity'), $ActivityUrl, 'Activity', Sprite('SpActivity').' '.T('Activity'));
            
         // Show notifications?
         if ($this->User->UserID == $Session->UserID) {
            $Notifications = T('Notifications');
            $NotificationsHtml = Sprite('SpNotifications').' '.$Notifications;
            $CountNotifications = $Session->User->CountNotifications;
            if (is_numeric($CountNotifications) && $CountNotifications > 0)
               $NotificationsHtml .= ' <span class="Aside"><span class="Count">'.$CountNotifications.'</span></span>';
               
            $this->AddProfileTab($Notifications, 'profile/notifications', 'Notifications', $NotificationsHtml);
         }
         
         // Show invitations?
         if (C('Garden.Registration.Method') == 'Invitation')
            $this->AddProfileTab(T('Invitations'), 'profile/invitations', 'InvitationsLink');
         
         $this->FireEvent('AddProfileTabs');
      }
      
      return TRUE;
   }