It's because in Admin Panel I set:
'Time in minutes before a member is considered "Offline" : 5'
So if I just load the site, and I do nothing else for 5 minutes, my status will change to "Offline"
For ChatBox, the "timeout" time is set to 10 or 15 minutes (I don't remember good).
Even if an user just visits the forum and then closes the tab, his chatbox status will remain "online" for next 10-15 minutes.
Why everytime it shows "leader has just logged off"?
I think it's because defaultly chatbox shows messages from last hour? (I'm not sure if it's 1 hour). Older messages go to Archive and you can still read them by clicking "Archive" button, however user-status messages are not stored in our database. Also sometimes all chat-box messages are cleared by moderators.
EDIT:
OK, I think it's time displaying problem in ChatBox, but I'm unable to repair it. Seems that it doesn't show user time-out time correctly: