In CUCM 7.1 and later the corporate directory is a service, you can create your own directories, create the related directory service and subscribe the phones you need want to each one.
You'll need to develop your own custom directories and only populate them with the info you need per office.
If this helps, please rate
What Java is getting at (+5 J) is that you can build a custom web application that parses out the directories in the manner you describe. The Corporate Directory application built into CUCM is really just a web app that exchanges XML messages with the phone to present data stored in the end user table.
There is (or was) a phone SDK available on the developer site (http://developer.cisco.com) which had a corporate directory example. You wouldn't be able to use it "as is" and reach your goal. But it would give you something to start with. I had to write something similar to what you a looking once. The ease of implementation would also depend on where you are pulling the data and what attributes you have available to filter the data accurately. But that is getting ahead of ourselves.
You first need to decide if you want to invest the time to build a custom app. Which may or may not be difficult (depending on your coding capabilities/interest). Another option is paying someone to do it.
Well, it isn't necessary to build a custom directory for each group. You can build custom LDAP or even AXL/SOAP queries in your directory application. So, still one application with different views. You can leverage service parameters or even IP address information of the phone to determine which view to render. The approach would be dictated by requirements and the attributes one can key off of.
Just a clarification.
I can't recommend any specific "off-the-shelf" application or 3rd party. Mainly because I write my own directory applications if/when they are needed. So, you could search Google for an application vendor or you can look for a integrator/consulting company with the capability. I do this for customers from time-to-time. If you wanted some advice on what to look for, etc. then we can chat off line. You can send me a private message via CSC (click on Account>Private messages, it took me forever to realize it existed).