Kod:
http://www.forum.cs-portal.net/viewtopic.php?t=6189
poczytaj tu może jakoś Ci pomogłem