This if statement doesn't work. I would expect it to write "if" as the variable should be empty. Or failing that I would expect "else" but there are neither
You can also see it on JSFiddle in full not working glory
I think JSFiddle maybe having problems at the moment
checkforthread();
function checkforthread() { // Check to see if it is a new or existing chat
// Set the variable
var existingthread = "";
document.write("test");
if (typeof(existingthread) == 'undefined' || variable == null) {
document.write("if");
gotostage3();
}
else {
document.write("else");
gotostage3();
}
}

variableisundefinedvariable. Did you intend to check ifexistingthread == nullinstead?typeofis an operator, not a function.