См. http://community.livejournal.com/fprog/20490.html.