code:
var Windows = Messenger.CurrentChats;
The Messenger.CurrentChats is a list of chat windows already open.
code:
var e = new Enumerator(Windows);
Here we enumerate the list so we can sort the chat windows individually.
code:
for(; !e.atEnd(); e.moveNext())
{
This is a start of a "for loop". Using the enumeration we did in the line before we go through each chat window object.
Here is some more information on loops in javascript:
http://www.w3schools.com/js/js_loop_for.asp
code:
var ChatWindow = e.item();
Here we define the current enumerated chat window as ChatWindow so it is easier to handle