code: public function generate($rootPageId, $blnReturn=false, $blnPreferAlias=false)
  	{
  		if (!$blnReturn)
  		{
  			$this->redirect($this->getRedirectUrl($rootPageId), 302);
  		}
  
  		$objNextPage = $this->getNextPage($rootPageId);
  
  		return ($blnPreferAlias && $objNextPage->alias != '') ? $objNextPage->alias : $objNextPage->id;
  	}
docs: Redirect to the first active regular page
  
  @param integer $rootPageId
  @param boolean $blnReturn
  @param boolean $blnPreferAlias
  
  @return integer