function getusername()
{
var ajaxreq; 

try
{
// Opera 8.0+, Firefox, Safari
ajaxreq = new XMLHttpRequest();
} 
catch (e)
{
// Internet Explorer Browsers
try
{
ajaxreq = new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e) 
{
try
{
ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
} 
catch (e)
{
return false;
}
}

}

ajaxreq.onreadystatechange = function()
{
if (ajaxreq.readyState == 4)
{
if (document.regform.username.value.length > 0)
{
//document.myForm.time.value = ajaxreq.responseText;
if (ajaxreq.responseText == 1)
{
document.getElementById("zone").innerHTML = "<font color=\"red\"><b>Unavailable</b></font>";
}
else if (ajaxreq.responseText == 2)
{
document.getElementById("zone").innerHTML = "<font color=\"red\"><b>Invalid username. Your username can only<br>contain numbers, letters and the following<br>characters: _=(){}[]<>?/\+-*$#</b></font>";
//Username contains an invalid character</b></font>";
}
else
{
document.getElementById("zone").innerHTML = "<font color=\"green\"><b>Available</b></font>";
}
}
}
}

ajaxreq.open("GET", "http://mossnews.com/cgi-bin/getusername.pl?username=" + document.regform.username.value, true);
ajaxreq.send(null); 
}


function click(a, b)
{
var ajaxreq; 

try
{
// Opera 8.0+, Firefox, Safari
ajaxreq = new XMLHttpRequest();
} 
catch (e)
{
// Internet Explorer Browsers
try
{
ajaxreq = new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e) 
{
try
{
ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
} 
catch (e)
{
return false;
}
}
}

ajaxreq.onreadystatechange = function()
{
if (ajaxreq.readyState == 4)
{
//document.myForm.time.value = ajaxreq.responseText;
document.getElementById("zone").innerHTML = "<font color=\"red\"><b>" + ajaxreq.responseText + ":" + a + "</b></font>";
}
}

ajaxreq.open("GET", "http://mossnews.com/cgi-bin/click.pl?a=" + a + "&b=" + b, true);
ajaxreq.send(null); 
}

function go(a,b,c)
{
document.location='http://mossnews.com/cgi-bin/click.pl?a='+a+'&b='+b+'&c='+c;
}
