http://petoftheday.com/talk/showthre...threadid=11885

I'm sure there is a far more elegant way to do this...but here's an earlier thread I started on this very subject!