Вот такая блок-схема
http://forum.fonarevka.ru/attachment.ph … 1292798843