Ported/generalized code from a client site. Added hook_civicrm_conditionalFields so other modules can implement custom configs.
Removed 4.5 from the supported list of CiviCRM versions. In 4.5 jQuery is referenced via CRM.$ rather than cj; this code would need some refactoring to support 4.5.