To defragment your indexes, we now use ALTER INDEX in SQL Server 2005 rather than DBCC DBREINDEX and DBCC INDEXDEFRAG, which have both been deprecated in 2005.
The REBUILD option of ALTER INDEX is equivalent to the old DBCC DBREINDEX; the REORGANIZE option of ALTER INDEX is equivalent to the old DBCC INDEXDEFRAG.
I have not yet written a stored procedure to run ALTER INDEX on the fragmented indexes, so I'll point you to two different resources.
1. In the sys.dm_db_index_physical_stats topic in SQL Server 2005 Books Online, you will find a script to defragment the indexes of a particular database. This script can be found in D of the Examples section.
2. I found this link when I googled "alter index" last week. It also can defragment the indexes of a particular database.
Both options have their strengths and weaknesses.
EDIT: My version of the code