Почитай и зашивай http://forum.tslabs.info/viewtopic.php?f=31&t=189