There was a HowtoComponent around called DynamicPrefiix which dnamically set the Content id prefix. It was used as an example in some of the courses.
You could potentially get a copy of that and set the prefix based on your rules. For example, if content type = "foo" then prefix = "bar" else prefix = "xxx".
I think Bex's site has an 11g copy on it: