In /etc/sysconfig/network-scripts/ifcfg-eth0, you should find the network info. Make two copies of it, with the set-up for both networks. You should then be able to write a script that attempts to contact the network after booting... If it can't contact the gateway, then it can switch the network set-up, restart the eth0, and attempt to contact again. If it can't contact after switching, it can tell you so.
# 3Com Corporation|3c905B 100BaseTX [Cyclone]