I don't think it would be that hard, but would be surprised if there are already some plugins that will help with that also :)
Ah, I see you can do it with code. But a plugin would certainly save us a lot of hassle.