and first try this
a couple of things I saw,
you are submitting via get request so dont need the form codecs,
you had set test to success long before your responseText kicked in so your testing would be invalid at that point anyway
function isSpecBook(fileid)
{
var test = "test";
if (window.XMLHttpRequest)
{
var req = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
var req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.onreadystatechange = function()
{
test = "success";
if ((req.readyState == 4) && (req.status == 200))
{
alert(req.responseText);
}
}
req.open("GET", "include/_process/isSpecBook.php?FileID="+fileid+"&json=1", true);
req.send(null);
}