Hello
First, thank you for your good wishes vis a vis my forum.
Second, can you help me? Just a short while ago my forum had a visitor from Malaysia. The visitor's opening activity seemed odd to me. His initial action seemed to be leaving me with a script. The wording in it makes me believe it is malicious. I will post it below for all to see. If my forum goes off tonight unexpectedly, you'll know why. Here is the script. (red highlights are my own) What do you make of it? Trying to hack or f.up my forum?
I have to split the post into two because it's too long for one.
var smf_formSubmitted = false;
// Define document.getElementById for Internet Explorer 4.
if (typeof(document.getElementById) == "undefined")
document.getElementById = function (id)
{
// Just return the corresponding index of all.
return document.all[id];
}
// Define XMLHttpRequest for IE 5 and above. (don't bother for IE 4 :/.... works in Opera 7.6 and Safari 1.2!)
else if (!window.XMLHttpRequest && window.ActiveXObject)
window.XMLHttpRequest = function

{
return new ActiveXObject(navigator.userAgent.indexOf("MSIE 5") != -1 ? "Microsoft.XMLHTTP" : "MSXML2.XMLHTTP");
};
// Some older versions of Mozilla don't have this, for some reason.
if (typeof(document.forms) == "undefined")
document.forms = document.getElementsByTagName("form");
// Load an XML document using XMLHttpRequest.
function getXMLDocument(url, callback)
{
if (!window.XMLHttpRequest)
return false;
var myDoc = new XMLHttpRequest();
if (typeof(callback) != "undefined")
{
myDoc.onreadystatechange = function

{
if (myDoc.readyState != 4)
return;
if (myDoc.responseXML != null && myDoc.status == 200)
callback(myDoc.responseXML);
};
}
myDoc.open('GET', url, true);
myDoc.send(null);
return true;
}
// Send a post form to the server using XMLHttpRequest.
function sendXMLDocument(url, content, callback)
{
if (!window.XMLHttpRequest)
return false;
var sendDoc = new window.XMLHttpRequest();
if (typeof(callback) != "undefined")
{
sendDoc.onreadystatechange = function

{
if (sendDoc.readyState != 4)
return;
if (sendDoc.responseXML != null && sendDoc.status == 200)
callback(sendDoc.responseXML);
else
callback(false);
};
}
sendDoc.open('POST', url, true);
if (typeof(sendDoc.setRequestHeader) != "undefined")
sendDoc.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
sendDoc.send(content);
return true;
}
function textToEntities(text)
{
var entities = "";
for (var i = 0; i < text.length; i++)
{
if (text.charCodeAt(i) > 127)
entities += "&#" + text.charCodeAt(i) + ";";
else
entities += text.charAt(i);
}
return entities;
}
// Open a new window.
function reqWin(desktopURL, alternateWidth, alternateHeight, noScrollbars)
{
if ((alternateWidth && self.screen.availWidth * 0.8 < alternateWidth) || (alternateHeight && self.screen.availHeight * 0.8 < alternateHeight))
{
noScrollbars = false;
alternateWidth = Math.min(alternateWidth, self.screen.availWidth * 0.

;
alternateHeight = Math.min(alternateHeight, self.screen.availHeight * 0.

;
}
else
noScrollbars = typeof(noScrollbars) != "undefined" && noScrollbars == true;
window.open(desktopURL, 'requested_popup', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=' + (noScrollbars ? 'no' : 'yes') + ',width=' + (alternateWidth ? alternateWidth : 480) + ',height=' + (alternateHeight ? alternateHeight : 220) + ',resizable=no');
//
Return false so the click won't follow the link 
.
return false;
}
// Remember the current position.
function storeCaret(text)
{
// Only bother if it will be useful.
if (typeof(text.createTextRange) != "undefined")
text.caretPos = document.selection.createRange().duplicate();
}
//
Replaces the currently selected text with the passed text.function replaceText(text, textarea)
{
// Attempt to create a text range (IE).
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
caretPos.select();
}
// Mozilla text range replace.
else if (typeof(textarea.selectionStart) != "undefined")
{
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;
textarea.value = begin + text + end;
if (textarea.setSelectionRange)
{
textarea.focus();
textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
}
textarea.scrollTop = scrollPos;
}
// Just put it on the end.
else
{
textarea.value += text;
textarea.focus(textarea.value.length - 1);
}
}
// Surrounds the selected text with text1 and text2.
function surroundText(text1, text2, textarea)
{
// Can a text range be created?
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
var caretPos = textarea.caretPos, temp_length = caretPos.text.length;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text1 + caretPos.text + text2 + ' ' : text1 + caretPos.text + text2;
if (temp_length == 0)
{
caretPos.moveStart("character", -text2.length);
caretPos.moveEnd("character", -text2.length);
caretPos.select();
}
else
textarea.focus(caretPos);
}
// Mozilla text range wrap.
else if (typeof(textarea.selectionStart) != "undefined")
{
var begin = textarea.value.substr(0, textarea.selectionStart);
var selection = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd - textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var newCursorPos = textarea.selectionStart;
var scrollPos = textarea.scrollTop;
textarea.value = begin + text1 + selection + text2 + end;
if (textarea.setSelectionRange)
{
if (selection.length == 0)
textarea.setSelectionRange(newCursorPos + text1.length, newCursorPos + text1.length);
else
textarea.setSelectionRange(newCursorPos, newCursorPos + text1.length + selection.length + text2.length);
textarea.focus();
}
textarea.scrollTop = scrollPos;
}
// Just put them on the end, then.
else
{
textarea.value += text1 + text2;
textarea.focus(textarea.value.length - 1);
}
}
// Checks if the passed input's value is nothing.
function isEmptyText(theField)
{
//
Copy the value so changes can be made..
var theValue = theField.value;
// Strip whitespace off the left side.
while (theValue.length > 0 && (theValue.charAt(0) == ' ' || theValue.charAt(0) == '\t'))
theValue = theValue.substring(1, theValue.length);
// Strip whitespace off the right side.
while (theValue.length > 0 && (theValue.charAt(theValue.length - 1) == ' ' || theValue.charAt(theValue.length - 1) == '\t'))
theValue = theValue.substring(0, theValue.length - 1);
if (theValue == '')
return true;
else
return false;
}
// Only allow form submission ONCE.
function submitonce(theform)
{
smf_formSubmitted = true;
}
function submitThisOnce(form)
{
//
Hateful, hateful fix for Safari 1.3 beta.
if (navigator.userAgent.indexOf('AppleWebKit') != -1)
return !smf_formSubmitted;
if (typeof(form.form) != "undefined")
form = form.form;
for (var i = 0; i < form.length; i++)
if (typeof(form
) != "undefined" && form.tagName.toLowerCase() == "textarea")
form.readOnly = true;
return !smf_formSubmitted;
}
// Set the "inside" HTML of an element.
function setInnerHTML(element, toValue)
{
// IE has this built in...
if (typeof(element.innerHTML) != 'undefined')
element.innerHTML = toValue;
// Otherwise, try createContextualFragment().
else
{
var range = document.createRange();
range.selectNodeContents(element);
range.deleteContents();
element.appendChild(range.createContextualFragment(toValue));
}