// Do all the initialising stuff first
window.onresize = sizecheck;
var activerequest = "0";
var X = "";
var Y = "";
var isMozilla = "";
var objDiv = "";
var over = "";
var DivID = "";
var fallback = 0;
var xmlhttp = false;
var output = "";
var params = "";
var myHeight = "";
var myWidth = "";
var lastnum = "";
var lasttot = "";
var quietset = "";
var curpage = "";
var hidden = "";
var useforum = "";
var lasturl = "";
var lastparams = "";
// Next all the AJAX stuff
function checkactive(url, parameters, quiet) {
if(quiet != "quiet") coverall('show');
if(activerequest == "0") makePOSTRequest(url, parameters, quiet);
else setTimeout("checkactive('" + url + "', '" + parameters + "', '" + quiet + "')", 500);
}
function makePOSTRequest(url, parameters, quiet) {
quietset = quiet;
if(quiet != "quiet") coverall('show');
params = parameters;
xmlhttp = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
xmlhttp = new XMLHttpRequest();
if (xmlhttp.overrideMimeType) {
// set type accordingly to anticipated content type
xmlhttp.overrideMimeType('text/html');
}
}
else if (window.ActiveXObject) { // IE
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!xmlhttp) {
var fallback = 1;
lowload();
return false;
}
lasturl = url;
lastparams = parameters;
setTimeout("cancelchk('" + url + "', 'n')", 20000);
if(url == "data/checkuser.inc.php") xmlhttp.onreadystatechange = checkuser;
else if(url == "data/findreported.inc.php") xmlhttp.onreadystatechange = reportedfound;
else if(url == "data/forum.inc.php") xmlhttp.onreadystatechange = listtopics;
else if(url == "data/forumlist.inc.php") xmlhttp.onreadystatechange = forumslist;
else if(url == "data/forumpass.inc.php") xmlhttp.onreadystatechange = forumpass;
else if(url == "data/forum_lookup.inc.php") xmlhttp.onreadystatechange = forumshow;
else if(url == "data/login.inc.php") xmlhttp.onreadystatechange = loggedin;
else if(url == "data/mod.inc.php") xmlhttp.onreadystatechange = moddone;
else if(url == "data/movetopic.inc.php") xmlhttp.onreadystatechange = topicmoved;
else if(url == "data/names.inc.php") xmlhttp.onreadystatechange = nameret;
else if(url == "data/notif.inc.php") xmlhttp.onreadystatechange = notifupdated;
else if(url == "data/previewpost.inc.php") xmlhttp.onreadystatechange = previewshow;
else if(url == "data/posts.inc.php") xmlhttp.onreadystatechange = content;
else if(url == "data/savesettings.inc.php") xmlhttp.onreadystatechange = settingssaved;
else if(url == "data/searchresults.inc.php") xmlhttp.onreadystatechange = showsearchresults;
else if(url == "data/topic_lookup.inc.php") xmlhttp.onreadystatechange = topicshow;
else if(url == "data/unread.inc.php") xmlhttp.onreadystatechange = unread;
else if(url == "data/markread.inc.php" || url == "data/markpmread.inc.php") xmlhttp.onreadystatechange = markread;
else if(url == "data/addmsg.inc.php" || url == "data/bbcode.inc.php" || url == "data/editsettings.inc.php" || url == "data/pms.inc.php" || url == "data/search.inc.php" || url == "data/signup.inc.php" || url == "data/user.inc.php") xmlhttp.onreadystatechange = shownewbox;
else if(url == "data/addpost.inc.php" || url == "data/pmsend.inc.php" || url == "data/reportpost.inc.php") xmlhttp.onreadystatechange = boxdestroy;
else xmlhttp.onreadystatechange = showresponse;
activerequest = "1";
document.getElementById('fl_cancelwait').style.display = "none";
setTimeout("cancelshow('" + url + "', '" + parameters + "')", 10000);
xmlhttp.open('POST', url, true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", parameters.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(parameters);
return false;
}
function cancelchk(passurl, userinit) {
if(passurl == lasturl && activerequest == "1") {
activerequest = "0";
coverall('hide');
xmlhttp.abort();
if(userinit == "n") msg('1<>Could not connect to server.');
}
}
function cancelclick() {
var passurl = lasturl;
activerequest = "1";
cancelchk(passurl, "y");
}
function cancelshow(url, params) {
if(url == lasturl && params == lastparams) document.getElementById('fl_cancelwait').style.display = "block";
}
function showresponse() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
alert(output);
}
}
}
function parseresponse(response) {
activerequest = "0";
var jschk = response.split("<><><>");
if(jschk[1]) {
var output = jschk[1];
var actions = jschk[0].split("???");
for(var i = 0; i < actions.length; i++) {
if(actions[i] == "getheights") setTimeout("getheights('1')", 500);
if(actions[i] == "login") login();
var msgchk = actions[i].split("()");
if(msgchk[0] == "msg") msg(msgchk[1]);
if(msgchk[0] == "unreadpms") unreadpms(msgchk[1]);
if(msgchk[0] == "unreadrps") unreadrps(msgchk[1]);
}
}
else var output = response;
return output;
}
function boxorder(topbox, output) {
document.getElementById(topbox).style.zIndex = "7";
if(topbox != "fl_search") document.getElementById('fl_search').style.zIndex = "5";
if(topbox != "fl_msgcompose") document.getElementById('fl_msgcompose').style.zIndex = "5";
if(topbox != "fl_userbox") document.getElementById('fl_userbox').style.zIndex = "5";
if(topbox != "fl_setsbox") document.getElementById('fl_setsbox').style.zIndex = "5";
if(topbox != "fl_pmbox") document.getElementById('fl_pmbox').style.zIndex = "5";
if(topbox != "fl_pmcompose") document.getElementById('fl_pmcompose').style.zIndex = "5";
if(topbox != "fl_modbox") document.getElementById('fl_modbox').style.zIndex = "5";
if(topbox != "fl_bbcode") document.getElementById('fl_bbcode').style.zIndex = "5";
document.getElementById(topbox).innerHTML = output;
document.getElementById(topbox).style.display = "inline";
}
// These are the scripts called when an AJAX request completes
function boxdestroy() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
if(lasturl == "data/addpost.inc.php") {
document.getElementById('fl_msgcompose').style.display = "none";
gettopicdetails(output);
}
if(lasturl == "data/pmsend.inc.php" || lasturl == "data/reportpost.inc.php") document.getElementById('fl_pmcompose').style.display = "none";
}
}
}
function checkuser() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
coverall('hide');
var output = xmlhttp.responseText;
output = output.split("<><>");
if(document.getElementById('fl_pmusercheck')) {
if(output[0] == "1") document.getElementById('fl_pmsendbox').style.display = "inline";
else document.getElementById('fl_pmsendbox').style.display = "none";
document.getElementById('fl_pmusercheck').innerHTML = output[1];
}
else if(document.getElementById('fl_signupusercheck')) {
if(output[0] == "1") document.getElementById('fl_addmsgrow').style.display = "inline";
else document.getElementById('fl_addmsgrow').style.display = "none";
document.getElementById('fl_signupusercheck').innerHTML = output[1];
}
else {
if(output[0] == "1") document.getElementById('fl_addmsgrow').style.display = "inline";
else document.getElementById('fl_addmsgrow').style.display = "none";
document.getElementById('fl_msgusercheck').innerHTML = output[1];
}
}
}
}
function content() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_curtopic').innerHTML = output;
}
}
}
function forumpass() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
coverall('hide');
msg(xmlhttp.responseText);
refreshview();
}
}
}
function forumslist() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
var split = output.split("()()");
document.getElementById('fl_totforums').innerHTML = split[0];
document.getElementById('fl_forumsbox').innerHTML = split[1];
}
}
}
function forumshow() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
var output = xmlhttp.responseText.split(",");
loadforum(output[0], output[1], 'quiet');
useforum = output[0];
setTimeout("gettopicdetails('0')", 500);
}
}
}
function listtopics() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
titlechk = output.split("^#^#^#^");
if(titlechk[1]) {
document.title = "Welcome To Genadyne Forum :: " + titlechk[0];
output = titlechk[1];
}
document.getElementById('fl_topics').innerHTML = output;
sizecheck();
checkactive('data/unread.inc.php', params, quietset);
}
}
}
function loggedin() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_usercp').innerHTML = output;
refreshview();
}
}
}
function markread() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
if(output == "0" && document.getElementById('fl_unreadpmswrap')) document.getElementById('fl_unreadpmswrap').innerHTML = "";
else if(document.getElementById('fl_unreadpmswrap')) {
var chk = output.split("()()");
if(chk[0] == "pm") unreadpms(chk[1]);
if(chk[0] == "rp") unreadrps(chk[1]);
}
}
}
}
function moddone() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
if(output == "pm") {
checkactive('data/pms.inc.php', '');
}
if(output == "rp") {
checkactive('data/pms.inc.php', 'type=reported');
}
else {
setTimeout("gettopicdetails('" + output + "', '', 'quiet')", 1000);
refreshview();
}
}
}
}
function nameret() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_curtopicheader').innerHTML = output;
checkactive('data/posts.inc.php', params);
}
}
}
function notifupdated() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_notifbox').innerHTML = output;
}
}
}
function previewshow() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
var split = output.split("()()()()");
document.getElementById('fl_curtopicheader').innerHTML = split[0];
document.getElementById('fl_curtopic').innerHTML = split[1];
}
}
}
function reportedfound() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
var output = output.split("()()");
gettopicdetails(output[0], output[1], 'report');
}
}
}
function showsearchresults() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_searchresults').innerHTML = output;
}
}
}
function settingssaved() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var output = parseresponse(xmlhttp.responseText);
document.getElementById('fl_cpanel').style.display = "none";
document.getElementById('fl_jscomm').innerHTML = document.location;
var output = document.getElementById('fl_jscomm').innerHTML.split("#");
if(output[1]) var output2 = output[1].split(",");
if(output2) {
if(output2[0] == "topic") {
if(output2[2]) {
if(output2[2] == "pageno") curpage = output2[3];
}
gettopicdetails(output2[1]);
}
if(output2[0] == "forum") getforumdetails(output2[1]);
}
else {
coverall('hide');
refreshview();
}
}
}
}
function shownewbox() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
if(lasturl == "data/bbcode.inc.php") boxorder('fl_bbcode', output);
if(lasturl == "data/addmsg.inc.php") boxorder('fl_msgcompose', output);
if(lasturl == "data/user.inc.php") boxorder('fl_userbox', output);
if(lasturl == "data/editsettings.inc.php") boxorder('fl_cpanel', output);
if(lasturl == "data/search.inc.php") boxorder('fl_search', output);
if(lasturl == "data/signup.inc.php") {
if(output == 0) document.getElementById('fl_signup').style.display = "none";
else boxorder('fl_signup', output);
}
if(lasturl == "data/pms.inc.php") {
var paramsplit = params.split("&");
if(paramsplit[0]) params = paramsplit[0];
if(params == "mode=compose") boxorder('fl_pmcompose', output);
else boxorder('fl_pmbox', output);
}
}
}
}
function topicmoved() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
coverall('hide');
var output = parseresponse(xmlhttp.responseText);
output = output.split("!!");
if(output[1]) {
coverall('show');
gettopicdetails(output[1]);
document.getElementById('fl_modbox').style.display = "none";
}
else boxorder('fl_modbox', output);
}
}
}
function topicshow() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
var output = xmlhttp.responseText.split(",");
showthread(output[2], output[0], output[1], params, curpage, 'quiet', output[3], '', output[4]);
}
}
}
function unread() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
activerequest = "0";
params = params.replace(/forum=/, "");
if(xmlhttp.responseText == "0" && document.getElementById('fl_unreadwrap_' + params)) document.getElementById('fl_unreadwrap_' + params).innerHTML = "";
else if(document.getElementById('fl_unreadwrap_' + params)) document.getElementById('fl_unreadwrap_' + params).innerHTML = " (" + xmlhttp.responseText + ")";
}
}
}
// More AJAX stuff - this is what submits the requests
function addpost(forumid, threadid, type) {
if(type == "reply" || type == "new") document.getElementById('fl_topicspage').innerHTML = "";
var username = getfield('fl_addmsgname');
if(document.getElementById('fl_addmsgsubject')) var subject = getfield('fl_addmsgsubject');
else var subject = "0";
var message = getfield('fl_addmsgmsg');
if(document.getElementById('fl_spamcode')) {
var spamcode = getfield('fl_spamcode');
}
if(document.getElementById('fl_posttype1')) {
if(document.getElementById('fl_posttype1').checked == true) var posttype = "1";
if(document.getElementById('fl_posttype2').checked == true) var posttype = "2";
if(document.getElementById('fl_posttype3').checked == true) var posttype = "3";
}
var typeadd = "";
if(type) typeadd = "&type=" + type;
if(posttype) typeadd += "&msgtype=" + posttype;
if(spamcode) typeadd += "&spamcode=" + spamcode;
if(username == "" || subject == "" || message == "") {
if(subject == "0") msg("2<>You must enter a username and message.");
else msg("2<>");
}
else checkactive('data/addpost.inc.php', 'forumid=' + forumid + '&topicid=' + threadid + '&username=' + username + '&subject=' + subject + '&message=' + message + typeadd);
}
function forumenter(forum) {
var enteredpass = document.getElementById('fl_forumpass').value;
enteredpass = calcMD5(enteredpass);
checkactive('data/forumpass.inc.php', 'forum=' + forum + '&enteredpass=' + enteredpass);
}
function getforumdetails(passed) {
setTimeout("checkactive('data/forum_lookup.inc.php', 'forumid=" + passed + "')", 1000);
}
function gettopicdetails(passed, page, isreport) {
if(page) curpage = page;
if(isreport) var addon = "&reported=" + document.getElementById('fl_rppass').innerHTML;
else var addon = "";
if(passed == "0") {
if(useforum != "") setTimeout("checkactive('data/topic_lookup.inc.php', 'forumid=" + useforum + "')", 1000);
}
else setTimeout("checkactive('data/topic_lookup.inc.php', 'topicid=" + passed + addon + "')", 1000);
}
function loadforum(num, tot, quiet, page) {
useforum = num;
document.getElementById('fl_jscomm').innerHTML = document.location;
var curthr = "";
var output = document.getElementById('fl_jscomm').innerHTML.split("#");
if(output[1]) var output2 = output[1].split(",");
if(output2) {
if(output2[0] == "topic") {
curthr = '&curthr=' + output2[1];
}
}
if(page) document.getElementById('fl_topicspage').innerHTML = page;
curthr += "&tot=" + tot + "&page=" + document.getElementById('fl_topicspage').innerHTML;
lastnum = num;
lasttot = tot;
if(quiet != "quiet") document.getElementById('fl_topics').innerHTML = "";
if(quiet != "quiet") checkactive('data/forum.inc.php', 'forum=' + num + curthr);
else checkactive('data/forum.inc.php', 'forum=' + num + curthr, 'quiet');
if(quiet != "quiet") setTimeout("gettopicdetails('0')", 500);
var forcount = 1;
var last = document.getElementById('fl_totforums').innerHTML;
while(forcount <= last) {
if(document.getElementById('fl_forumid' + forcount)) {
if(forcount == tot) document.getElementById('fl_forumid' + forcount).style.fontWeight = "bold";
else document.getElementById('fl_forumid' + forcount).style.fontWeight = "normal";
}
forcount++;
}
return false;
}
function loadforums(quiet) {
if(quiet != "quiet") document.getElementById('fl_forumsbox').innerHTML = "";
if(quiet != "quiet") checkactive('data/forumlist.inc.php', '');
else checkactive('data/forumlist.inc.php', '', 'quiet');
return false;
}
function login() {
if(document.getElementById('user')) {
var user = getfield('user');
var pass = getfield('pass');
var remember = document.getElementById('remember').checked;
if(remember == true) remember = 1;
else remember = 0;
pass = calcMD5(pass);
document.getElementById('pass').value = pass;
checkactive('data/login.inc.php', 'user=' + user + '&pass=' + pass + '&remember=' + remember);
}
else checkactive('data/login.inc.php', 'mode=out');
}
function markall() {
checkactive('data/markread.inc.php', '');
}
function markpmread(message, type) {
checkactive('data/markpmread.inc.php', 'type=' + type + '&message=' + message, 'quiet');
}
function mod(action, passed) {
checkactive('data/mod.inc.php', action + "=" + passed);
}
function notif(passed) {
checkactive('data/notif.inc.php', 'topicid=' + passed);
}
function previewpost() {
var username = getfield('fl_addmsgname');
if(document.getElementById('fl_addmsgsubject')) var subject = getfield('fl_addmsgsubject');
else var subject = "0";
var message = getfield('fl_addmsgmsg');
if(document.getElementById('fl_posttype1')) {
if(document.getElementById('fl_posttype1').checked == true) var posttype = "1";
if(document.getElementById('fl_posttype2').checked == true) var posttype = "2";
if(document.getElementById('fl_posttype3').checked == true) var posttype = "3";
}
var typeadd = "";
if(posttype) typeadd += "&msgtype=" + posttype;
checkactive('data/previewpost.inc.php', 'username=' + username + '&subject=' + subject + '&message=' + message + typeadd);
}
function reportpost() {
var topicid = getfield('fl_topicid');
var postid = getfield('fl_postid');
var message = getfield('fl_rpmessage');
checkactive('data/reportpost.inc.php', 'topicid=' + topicid + '&postid=' + postid + '&message=' + message);
}
function savesettings() {
var realname = getfield('fl_realname');
var email = getfield('fl_email');
var homepage = getfield('fl_homepage');
var msn = getfield('fl_msn');
var aol = getfield('fl_aol');
var icq = getfield('fl_icq');
var skype = getfield('fl_skype');
var dobyr = getfield('fl_dobyr');
var dobmn = getfield('fl_dobmn');
var dobdy = getfield('fl_dobdy');
var offset = getfield('fl_offset');
var profile = getfield('fl_profile');
var sig = getfield('fl_sig');
var oldpw = getfield('fl_oldpw');
var newpw1 = getfield('fl_newpw1');
var newpw2 = getfield('fl_newpw2');
if(document.getElementById('fl_emailpriv1').checked == true) var emailpriv = "1";
if(document.getElementById('fl_emailpriv0').checked == true) var emailpriv = "0";
if(document.getElementById('fl_pmnotify1').checked == true) var pmnotify = "1";
if(document.getElementById('fl_pmnotify0').checked == true) var pmnotify = "0";
if(document.getElementById('fl_sigs1').checked == true) var sigs = "1";
if(document.getElementById('fl_sigs0').checked == true) var sigs = "0";
if(document.getElementById('fl_sigims1').checked == true) var sigims = "1";
if(document.getElementById('fl_sigims0').checked == true) var sigims = "0";
if(document.getElementById('fl_sexm').checked == true) var sex = "m";
if(document.getElementById('fl_sexf').checked == true) var sex = "f";
if(document.getElementById('fl_sexn').checked == true) var sex = "";
checkactive('data/savesettings.inc.php', 'realname=' + realname + '&email=' + email + '&homepage=' + homepage + '&msn=' + msn + '&aol=' + aol + '&icq=' + icq + '&skype=' + skype + '&dobyr=' + dobyr + '&dobmn=' + dobmn + '&dobdy=' + dobdy + '&profile=' + profile + '&sig=' + sig + '&emailpriv=' + emailpriv + '&pmnotify=' + pmnotify + '&sigs=' + sigs + '&sigims=' + sigims + '&sex=' + sex + '&offset=' + offset + '&oldpw=' + oldpw + '&newpw1=' + newpw1 + '&newpw2=' + newpw2);
}
function searchresults() {
var searchtext = getfield('fl_searchtext');
var searchuser = getfield('fl_searchuser');
var searchtime = getfield('fl_searchtime');
if(document.getElementById('fl_searchtype1').checked == true) var searchtype = "all";
if(document.getElementById('fl_searchtype2').checked == true) var searchtype = "exact";
var selectedArray = new Array();
var selObj = document.getElementById('fl_searchforums');
var i;
var count = 0;
for (i=0; i myWidth) X = X - 1;
while(Y + (useheight * 1) > myHeight) Y = Y - 1;
document.getElementById(boxid).style.left = X + "px";
document.getElementById(boxid).style.top = Y + "px";
if(boxid == "fl_userbox") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/user.inc.php', 'userlook=' + passed);
}
if(boxid == "fl_pmbox") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/pms.inc.php', passed);
}
if(boxid == "fl_pmcompose") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/pms.inc.php', 'mode=compose' + passed);
}
if(boxid == "fl_msgcompose") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/addmsg.inc.php', passed);
}
if(boxid == "fl_bbcode") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/bbcode.inc.php', passed);
}
if(boxid == "fl_cpanel") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/editsettings.inc.php', passed);
}
if(boxid == "fl_search") {
document.getElementById(boxid).innerHTML = "";
checkactive('data/search.inc.php', passed);
}
if(boxid == "fl_modbox") {
if(passed == "selected") {
var topicid = document.getElementById('fl_topicid').value;
if(document.getElementById('fl_newforum')) {
var newforum = document.getElementById('fl_newforum').value;
checkactive('data/movetopic.inc.php', 'topicid=' + topicid + '&newforum=' + newforum);
}
else {
var newtopicid = document.getElementById('fl_newtopicid').value;
checkactive('data/movetopic.inc.php', 'topicid=' + topicid + '&newtopicid=' + newtopicid);
}
}
else {
document.getElementById(boxid).innerHTML = "";
checkactive('data/movetopic.inc.php', passed);
}
}
if(boxid == "fl_signup") {
if(passed == "signup") {
document.getElementById(boxid).style.display = "none";
var newuser = getfield('fl_newuser');
var newpass1 = getfield('fl_newpass1');
var newpass2 = getfield('fl_newpass2');
var newemail = getfield('fl_newemail');
if(newuser != "" && newpass1 != "" && newpass2 != "" && newemail != "") {
if(newpass1 == newpass2) {
newpass1 = calcMD5(newpass1);
newpass2 = calcMD5(newpass2);
checkactive('data/signup.inc.php', 'newuser=' + newuser + '&newpass=' + newpass1 + '&newemail=' + newemail);
}
else msg("1<>Your passwords do not match.");
}
else msg("1<>You must fill in all fields.");
}
else if(passed == "reset") {
document.getElementById(boxid).style.display = "none";
var passuser = getfield('fl_passuser');
var passemail = getfield('fl_passemail');
if(passuser != "" && passemail != "") checkactive('data/signup.inc.php', 'passuser=' + passuser + '&passemail=' + passemail);
else msg("1<>You must fill in all fields.");
}
else checkactive('data/signup.inc.php', passed);
}
}
function showreported(topicid, postid) {
document.getElementById('fl_rppass').innerHTML = postid;
checkactive('data/findreported.inc.php', 'topicid=' + topicid + '&postid=' + postid);
}
function showthread(num, forum, unread, threadid, pageno, quiet, reported, revtot, topicpage) {
if (topicpage) document.getElementById('fl_topicspage').innerHTML = topicpage;
var threadsplit = threadid.split("=");
if(threadsplit[1]) {
threadid = threadsplit[1];
var chk = threadid.split("&");
if(chk[1]) threadid = chk[0];
if(forum != "_") setTimeout("loadforum('" + forum + "', '" + unread + "', 'quiet')", 1000);
}
var pageset = "";
if(pageno) pageset = "&curpage=" + pageno;
document.getElementById('fl_jscomm').innerHTML = document.location;
var output = document.getElementById('fl_jscomm').innerHTML.split("#");
var output2 = output[1].split(",");
if(forum != "_") document.location = output[0] + "#topic," + threadid;
if(pageno && forum != "_") document.location += ",pageno," + pageno;
if(unread == "u" && document.getElementById('fl_thread_' + revtot).style.fontWeight == "bold") {
if(document.getElementById('fl_unread_' + forum)) {
var curunread = document.getElementById('fl_unread_' + forum).innerHTML;
var newunread = curunread - 1;
if(newunread == "0") document.getElementById('fl_unreadwrap_' + forum).innerHTML = "";
else document.getElementById('fl_unread_' + forum).innerHTML = newunread;
}
}
var threadcount = 1;
while(document.getElementById('fl_thread_' + threadcount)) {
if(threadcount == revtot) {
document.getElementById('fl_thread_' + threadcount).style.backgroundColor = "#769cda";
document.getElementById('fl_thread_' + threadcount).style.color = "#fff";
document.getElementById('fl_thread_' + threadcount).style.fontWeight = "normal";
}
else {
if(Math.floor(threadcount / 2) == threadcount / 2) document.getElementById('fl_thread_' + threadcount).style.backgroundColor = "#eee";
else document.getElementById('fl_thread_' + threadcount).style.backgroundColor = "#fff";
document.getElementById('fl_thread_' + threadcount).style.color = "#000";
}
threadcount++;
}
if(forum != "_" || document.getElementById('fl_curtopic').innerHTML == "" || !num) {
document.getElementById('fl_curtopic').innerHTML = "";
if (forum == "_") forum = threadid;
if(reported != "") pageset += "&reported=" + document.getElementById('fl_rppass').innerHTML;
checkactive('data/names.inc.php', 'forum=' + forum + '&thread=' + num + pageset, quiet);
}
return false;
}
function usercheck() {
if(document.getElementById('fl_pmto')) {
var username = getfield('fl_pmto');
checkactive('data/checkuser.inc.php', 'user=' + username, 'quiet');
}
else if(document.getElementById('fl_newuser')) {
var username = getfield('fl_newuser');
checkactive('data/checkuser.inc.php', 'type=forumpost&user=' + username, 'quiet');
}
else {
var username = getfield('fl_addmsgname');
checkactive('data/checkuser.inc.php', 'type=forumpost&user=' + username, 'quiet');
}
}
// Next things that run on startup and on page resize
function allinit() {
setTimeout('refreshview()', 60000);
document.getElementById('fl_jscomm').innerHTML = document.location;
var output = document.getElementById('fl_jscomm').innerHTML.split("#");
if(output[1]) {
var output2 = output[1].split(",");
}
if(output2) {
if(output2[0] == "forum") {
getforumdetails(output2[1]);
}
if(output2[0] == "topic") {
if(output2[2]) {
if(output2[2] == "pageno") curpage = output2[3];
}
gettopicdetails(output2[1]);
}
else loadforum('', '', 'quiet');
}
else loadforum('', '', 'quiet');
sizecheck();
isMozilla = (document.all) ? 0 : 1;
if (isMozilla) {
if(document.addEventListener) {
document.addEventListener("mousedown", MouseDown, true);
document.addEventListener("mousemove", MouseMove, true);
document.addEventListener("mouseup", MouseUp, true);
}
else document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
}
document.onmousedown = MouseDown;
document.onmousemove = MouseMove;
document.onmouseup = MouseUp;
}
function sizecheck() {
myWidth = 0;
myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
var rightheight = myHeight - 71;
var topicheight = myHeight - 283;
var rightwidth = (myWidth * 0.85) - 42;
var typewidth = rightwidth * 0.02;
var topicwidth = rightwidth * 0.4;
var creatorwidth = rightwidth * 0.2;
var replieswidth = rightwidth * 0.1;
var lastpostwidth = rightwidth * 0.28;
document.getElementById('fl_leftside').style.height = rightheight - 50 + "px";
document.getElementById('fl_rightside').style.height = rightheight + "px";
document.getElementById('fl_curtopicbox').style.height = topicheight + "px";
document.getElementById('fl_curtopic').style.height = topicheight - 31 + "px";
document.getElementById('fl_topictable').style.width = rightwidth + "px";
if(document.getElementById('fl_topictable2')) document.getElementById('fl_topictable2').style.width = rightwidth + "px";
document.getElementById('fl_typehead').style.width = typewidth + "px";
document.getElementById('fl_topichead').style.width = topicwidth + "px";
document.getElementById('fl_creatorhead').style.width = creatorwidth + "px";
document.getElementById('fl_replieshead').style.width = replieswidth + "px";
document.getElementById('fl_lastposthead').style.width = lastpostwidth + "px";
if(document.getElementById('fl_typehead2')) document.getElementById('fl_typehead2').style.width = typewidth + "px";
if(document.getElementById('fl_topichead2')) document.getElementById('fl_topichead2').style.width = topicwidth + "px";
if(document.getElementById('fl_creatorhead2')) document.getElementById('fl_creatorhead2').style.width = creatorwidth + "px";
if(document.getElementById('fl_replieshead2')) document.getElementById('fl_replieshead2').style.width = replieswidth + "px";
if(document.getElementById('fl_lastposthead2')) document.getElementById('fl_lastposthead2').style.width = lastpostwidth + "px";
}
// Next the scripts for the message bar
function msg(toshow) {
var msgsplit = toshow.split("<>");
var no = msgsplit[0];
var msg = msgsplit[1];
msg = msg.replace(/\\\'/g, "'");
if(document.getElementById('fl_bar').style.marginTop != "0px") {
document.getElementById('fl_bar').style.display = 'inline';
document.getElementById('fl_msgbar').style.backgroundRepeat = 'repeat-x';
if(no == 1) {
var sect = 'Error';
document.getElementById('fl_msgbar').style.backgroundColor = '#903';
document.getElementById('fl_msgbar').style.backgroundImage = 'url(gfx/msg_1.gif)';
}
else if(no == 2) {
var sect = 'Alert';
document.getElementById('fl_msgbar').style.backgroundColor = '#39c';
document.getElementById('fl_msgbar').style.backgroundImage = 'url(gfx/msg_2.gif)';
}
else if(no == 3) {
var sect = 'Success';
document.getElementById('fl_msgbar').style.backgroundColor = '#096';
document.getElementById('fl_msgbar').style.backgroundImage = 'url(gfx/msg_3.gif)';
}
else {
var sect = no;
document.getElementById('fl_msgbar').style.backgroundColor = '#333';
document.getElementById('fl_msgbar').style.backgroundImage = 'url(gfx/msg_4.gif)';
}
document.getElementById('fl_msgbar').innerHTML = '' + sect + '
' + msg;
msgshow();
var hidetime = 1000 * 5;
if(hidetime != 0) setTimeout("msghide()", hidetime);
}
else {
toshow = toshow.replace(/"/g, '\"');
toshow = toshow.replace(/'/g, '\\\'');
setTimeout("msg('" + toshow + "')", 1000);
window.status = toshow;
}
}
function msghide() {
if(hidden != 1) {
for(var x = 0; x >= "-80"; x = x - 1) {
var y = 7 * (80 - x);
if(y < 0) y = 0;
setTimeout("document.getElementById('fl_bar').style.marginTop = \"" + x + "px\"", y);
}
hidden = 1;
}
}
function msgshow() {
hidden = 0;
for(var x = "-80"; x <= 0; x++) {
var y = 7 * (x + 80);
if(y < 0) y = 0;
setTimeout("document.getElementById('fl_bar').style.marginTop = \"" + x + "px\"", y);
}
}
// Then the mouse move stuff
function MouseDown(e) {
if (over) {
document.getElementById(DivID).style.zIndex = "7";
if(DivID != "fl_userbox") document.getElementById('fl_userbox').style.zIndex = "5";
if(DivID != "fl_pmbox") document.getElementById('fl_pmbox').style.zIndex = "5";
if(DivID != "fl_pmcompose") document.getElementById('fl_pmcompose').style.zIndex = "5";
if(DivID != "fl_setsbox") document.getElementById('fl_setsbox').style.zIndex = "5";
if(DivID != "fl_modbox") document.getElementById('fl_modbox').style.zIndex = "5";
if(DivID != "fl_msgcompose") document.getElementById('fl_msgcompose').style.zIndex = "5";
if(DivID != "fl_bbcode") document.getElementById('fl_bbcode').style.zIndex = "5";
if(DivID != "fl_cpanel") document.getElementById('fl_cpanel').style.zIndex = "5";
if(DivID != "fl_search") document.getElementById('fl_search').style.zIndex = "5";
if(DivID != "fl_signup") document.getElementById('fl_signup').style.zIndex = "5";
if (isMozilla) {
objDiv = document.getElementById(DivID);
X = e.layerX;
Y = e.layerY;
return false;
}
else {
objDiv = document.getElementById(DivID);
objDiv = objDiv.style;
X = event.offsetX;
Y = event.offsetY;
}
}
return true;
}
function MouseMove(e) {
if (objDiv) {
if(DivID == "fl_userbox") {
var usewidth = "304";
var useheight = "204";
}
if(DivID == "fl_search") {
var usewidth = "504";
var useheight = "404";
}
if(DivID == "fl_pmbox" || DivID == "fl_pmcompose" || DivID == "fl_msgcompose" || DivID == "fl_signup" || DivID == "fl_cpanel") {
var usewidth = "404";
var useheight = "304";
}
if(DivID == "fl_modbox") {
var usewidth = "254";
var useheight = "84";
}
if(DivID == "fl_bbcode") {
var usewidth = "219";
var useheight = "114";
}
if (isMozilla) {
if(e.pageY - Y + (useheight * 1) > myHeight) objDiv.style.top = myHeight - useheight + 'px';
else if(e.pageY - Y < 0) objDiv.style.top = '0px';
else objDiv.style.top = (e.pageY-Y) + 'px';
if(e.pageX - X + (usewidth * 1) > myWidth) objDiv.style.left = myWidth - usewidth + 'px';
else if(e.pageX - X < 0) objDiv.style.left = '0px';
else objDiv.style.left = (e.pageX-X) + 'px';
return false;
}
else {
if(event.clientX-X + document.body.scrollLeft + (usewidth * 1) > myWidth) return false;
else if(event.clientX-X + document.body.scrollLeft < 0) objDiv.pixelLeft = '0px';
else objDiv.pixelLeft = event.clientX-X + document.body.scrollLeft;
if(event.clientY-Y + document.body.scrollTop + (useheight * 1) > myHeight) return false;
else if(event.clientY-Y + document.body.scrollTop < 0) objDiv.pixelTop = '0px';
else objDiv.pixelTop = event.clientY-Y + document.body.scrollTop;
return false;
}
}
else {
if (isMozilla) {
X = e.pageX;
Y = e.pageY;
}
else {
X = event.clientX + document.body.scrollLeft;
Y = event.clientY + document.body.scrollTop;
}
}
return true;
}
function MouseUp() {
objDiv = null;
return true;
}
// Miscellaneous other bits
function closebox(boxid) {
document.getElementById(boxid).style.display = "none";
}
function coverall(action) {
if(action == "show") document.getElementById('fl_coverall').style.display = "inline";
else {
document.getElementById('fl_cancelwait').style.display = "none";
document.getElementById('fl_coverall').style.display = "none";
}
}
function getfield(fieldname) {
var grabbed = document.getElementById(fieldname).value;
grabbed = grabbed.replace(/&/g, "%26");
grabbed = grabbed.replace(/\+/g, "%2B");
grabbed = grabbed.replace(/#/g, "%23");
return grabbed;
}
function insertAtCursor(myField, myValue) {
// IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
// Mozilla/others support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
myField.selectionStart = endPos + myValue.length;
myField.selectionEnd = endPos + myValue.length;
}
else {
myField.value += myValue;
}
}
function hover(id) {
if(document.getElementById('fl_thread_' + id).style.backgroundColor == "rgb(238, 238, 238)" || document.getElementById('fl_thread_' + id).style.backgroundColor == "rgb(255, 255, 255)" || document.getElementById('fl_thread_' + id).style.backgroundColor == "#fff" || document.getElementById('fl_thread_' + id).style.backgroundColor == "#eee") document.getElementById('fl_thread_' + id).style.backgroundColor = "#fda";
else if(document.getElementById('fl_thread_' + id).style.backgroundColor == "rgb(255, 221, 170)" || document.getElementById('fl_thread_' + id).style.backgroundColor == "#fda") {
if(Math.floor(id / 2) == id / 2) document.getElementById('fl_thread_' + id).style.backgroundColor = "#eee";
else document.getElementById('fl_thread_' + id).style.backgroundColor = "#fff";
}
}
function imghoveron(id, imgname) {
document.getElementById(id).style.backgroundImage = "url(gfx/icons/" + imgname + "_hover.gif)";
}
function imghoveroff(id, imgname) {
document.getElementById(id).style.backgroundImage = "url(gfx/icons/" + imgname + ".gif)";
}
function lowload() {
document.getElementById('fl_jscomm').innerHTML = document.location;
var check = document.getElementById('fl_jscomm').innerHTML.split("index.ph");
if(check[1]) var output = check[0].split("#");
else var output = document.getElementById('fl_jscomm').innerHTML.split("#");
if(output[1]) {
var topass = output[1].split(",");
var passon = "?" + topass[0] + "=" + topass[1];
if(topass[2]) passon += "&" + topass[2] + "=" + topass[3];
document.location = output[0] + "low.php" + passon;
}
else document.location = output + "low.php";
}
function putcode(element, chars) {
insertAtCursor(document.getElementById(element), chars + " ");
document.getElementById(element).focus();
if(element == "fl_addmsgmsg") document.getElementById('fl_msgcompose').style.zIndex = "8";
if(element == "fl_pmmessage") document.getElementById('fl_pmcompose').style.zIndex = "8";
}
function refreshview() {
if(activerequest != "1") {
loadforums('quiet');
setTimeout("loadforum('" + lastnum + "', '" + lasttot + "', 'quiet')", 1000);
}
setTimeout("refreshview()", 60000);
}
function rssload(forumid) {
window.location = "rss.php?forum=" + forumid;
}
function showip(id) {
document.getElementById('fl_ip' + id).style.display = "inline";
}
function unreadrps(num) {
if(document.getElementById('fl_unreadrpswrap')) {
if(num > 0) document.getElementById('fl_unreadrpswrap').innerHTML = " (" + num + ")";
else document.getElementById('fl_unreadrpswrap').innerHTML = "";
}
}
function unreadpms(num) {
if(document.getElementById('fl_unreadpmswrap')) {
if(num > 0) document.getElementById('fl_unreadpmswrap').innerHTML = " (" + num + ")";
else document.getElementById('fl_unreadpmswrap').innerHTML = "";
}
}
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Copyright (C) Paul Johnston 1999 - 2000.
* Updated by Greg Holt 2000 - 2001.
* See http://pajhome.org.uk/site/legal.html for details.
*/
/*
* Convert a 32-bit number to a hex string with ls-byte first
*/
var olda = "";
var oldb = "";
var oldc = "";
var oldd = "";
var a = "";
var b = "";
var c = "";
var d = "";
var i = "";
var x = "";
var hex_chr = "0123456789abcdef";
function rhex(num)
{
var str = "";
var j = "";
for(j = 0; j <= 3; j++)
str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +
hex_chr.charAt((num >> (j * 8)) & 0x0F);
return str;
}
/*
* Convert a string to a sequence of 16-word blocks, stored as an array.
* Append padding bits and the length, as described in the MD5 standard.
*/
function str2blks_MD5(str)
{
var nblk = ((str.length + 8) >> 6) + 1;
var blks = new Array(nblk * 16);
var i = "";
for(i = 0; i < nblk * 16; i++) blks[i] = 0;
for(i = 0; i < str.length; i++)
blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
blks[i >> 2] |= 0x80 << ((i % 4) * 8);
blks[nblk * 16 - 2] = str.length * 8;
return blks;
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left
*/
function rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* These functions implement the basic operation for each round of the
* algorithm.
*/
function cmn(q, a, b, x, s, t)
{
return add(rol(add(add(a, q), add(x, t)), s), b);
}
function ff(a, b, c, d, x, s, t)
{
return cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function gg(a, b, c, d, x, s, t)
{
return cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function hh(a, b, c, d, x, s, t)
{
return cmn(b ^ c ^ d, a, b, x, s, t);
}
function ii(a, b, c, d, x, s, t)
{
return cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Take a string and return the hex representation of its MD5.
*/
function calcMD5(str)
{
x = str2blks_MD5(str);
a = 1732584193;
b = -271733879;
c = -1732584194;
d = 271733878;
for(i = 0; i < x.length; i += 16)
{
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = ff(c, d, a, b, x[i+10], 17, -42063);
b = ff(b, c, d, a, x[i+11], 22, -1990404162);
a = ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = ff(d, a, b, c, x[i+13], 12, -40341101);
c = ff(c, d, a, b, x[i+14], 17, -1502002290);
b = ff(b, c, d, a, x[i+15], 22, 1236535329);
a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = gg(c, d, a, b, x[i+11], 14, 643717713);
b = gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = gg(d, a, b, c, x[i+10], 9 , 38016083);
c = gg(c, d, a, b, x[i+15], 14, -660478335);
b = gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = gg(b, c, d, a, x[i+12], 20, -1926607734);
a = hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = hh(c, d, a, b, x[i+11], 16, 1839030562);
b = hh(b, c, d, a, x[i+14], 23, -35309556);
a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = hh(b, c, d, a, x[i+10], 23, -1094730640);
a = hh(a, b, c, d, x[i+13], 4 , 681279174);
d = hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = hh(d, a, b, c, x[i+12], 11, -421815835);
c = hh(c, d, a, b, x[i+15], 16, 530742520);
b = hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = ii(c, d, a, b, x[i+14], 15, -1416354905);
b = ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = ii(c, d, a, b, x[i+10], 15, -1051523);
b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = ii(d, a, b, c, x[i+15], 10, -30611744);
c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = ii(b, c, d, a, x[i+13], 21, 1309151649);
a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = ii(d, a, b, c, x[i+11], 10, -1120210379);
c = ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = add(a, olda);
b = add(b, oldb);
c = add(c, oldc);
d = add(d, oldd);
}
return rhex(a) + rhex(b) + rhex(c) + rhex(d);
}
var secheights = new Array;
function getheights(showstart) {
var i = 1;
var stop = 0;
while(stop == 0) {
if(document.getElementById('sec' + i + '_b')) {
secheights[i] = document.getElementById('sec' + i + '_b').scrollHeight;
document.getElementById('sec' + i + '_b').style.display = "none";
document.getElementById('sec' + i + '_h').className = "fl_pmheadoff";
}
else {
stop = 1;
}
i++;
}
secshow();
}
function secshow(usenum) {
document.getElementById('cursec').innerHTML = usenum;
if(document.getElementById('sec' + usenum + '_b')) {
if(document.getElementById('sec' + usenum + '_b').style.display == "block") {
var curheight = document.getElementById('sec' + usenum + '_b').offsetHeight;
var timecount = 0;
for(var j = curheight; j >= 0; j = j - 1) {
setTimeout("document.getElementById('sec" + usenum + "_b').style.height = " + j + " + 'px'", timecount / 2);
if(j == 0) {
setTimeout("document.getElementById('sec" + usenum + "_b').style.display = 'none'", timecount / 2);
}
timecount++;
}
document.getElementById('sec' + usenum + '_c').innerHTML = "[+]";
document.getElementById('sec' + usenum + '_h').className = "fl_pmheadoff";
}
else {
var i = 1;
var stop = 0;
while(stop == 0) {
if(document.getElementById('sec' + i + '_b')) {
if(i != usenum && document.getElementById('sec' + i + '_b').style.display == "block") {
var curheight = document.getElementById('sec' + i + '_b').offsetHeight;
var timecount = 0;
for(var j = curheight; j >= 0; j = j - 1) {
setTimeout("document.getElementById('sec" + i + "_b').style.height = " + j + " + 'px'", timecount / 2);
if(j == 0) {
setTimeout("document.getElementById('sec" + i + "_b').style.display = 'none'", timecount / 2);
}
timecount++;
}
document.getElementById('sec' + i + '_c').innerHTML = "[+]";
document.getElementById('sec' + i + '_h').className = "fl_pmheadoff";
}
i++;
}
else {
stop = 1;
}
}
var newheight = secheights[usenum];
var newtimecount = 0;
document.getElementById('sec' + usenum + '_b').style.height = "0px";
document.getElementById('sec' + usenum + '_b').style.display = "block";
for(var j = 0; j <= newheight; j++) {
setTimeout("document.getElementById('sec" + usenum + "_b').style.height = " + j + " + 'px'", newtimecount);
newtimecount++;
}
document.getElementById('fl_unread_' + usenum).innerHTML = "";
document.getElementById('sec' + usenum + '_c').innerHTML = "[-]";
document.getElementById('sec' + usenum + '_h').className = "fl_pmhead";
}
}
}