Как вариант:
http://reibert.info/threads/%D0%91%D.../#post-4421914