var dFolders, cFolders; var genForums, aForums; var comtt; function Folder(id, tMsg, nMsg, name) { this.id = id; this.tMsg = tMsg; this.nMsg = nMsg; this.name = name; } function Category(id, type, name) { this.id = id; this.type = type; this.name = name; this.forums = new Array(); } function Forum(id, nTopics, nUnread, name) { this.id = id; this.nTopics = nTopics; this.nUnread = nUnread; this.name = name; } function initPage() { commsDataReceived(document.getElementById('init-data').value); } function commsDataReceived(data) { var i, l = data.split('\n'); var a = l.shift().split('#'); var nCustom = parseInt(a[0],10), nGenCats = parseInt(a[1],10), nAForums = parseInt(a[2],10); // Default folders dFolders = new Array(); for (i=0;i<3;i++) { a = l.shift().split('#'); dFolders.push(new Folder('', a[0], a[1], '')); } // Custom folders cFolders = new Array(); for (i=0;i' + cFolders[i].name + ': ' + makeMessagesText(cFolders[i].tMsg, cFolders[i].nMsg); a.push(s); } document.getElementById('cflist').innerHTML = a.join('
') + '
'; } // General forums a = new Array(); for (i=0;i' + name + ''; for (j=0;j' + forums[j].name + ': '; s += makeTopicsText(forums[j].nTopics, forums[j].nUnread); } a.push(s); }} document.getElementById('gforums').innerHTML = a.join('

'); // Alliance forums if (aForums.length == 0) document.getElementById('aforums').innerHTML = ' '; else { a = new Array(); for (j=0;j' + aForums[j].name + ': '; s += makeTopicsText(aForums[j].nTopics, aForums[j].nUnread); a.push(s); } document.getElementById('aforums').innerHTML = '

' + allianceForums + '

' + a.join('
') + '

'; } }