That's an older system; so you'll need an AGP graphics card. I wouldn't spent a lot on an AGP card, but you should be able to find a dual-output card with fairly nice specifications for the equivalent of ~ $75-100 US. Something like a Sapphire Radeon HD3650 or an eVGA GE Force 7600GT.
If you're going to simply switch between the monitor and TV, do NOT "hot plug" the DVI connection. Shut down; change the connection; then reboot & set the appropriate display settings. DVI is NOT designed for hot-plugging :-) Note that the various DVI switching devices you can buy are designed to share a single display between 2 (or more) source devices (computers) ==> NOT to share multiple displays between one source device.