function checkPasswords(){
	var string = document.forms.register_form.password.value;

	if (string.length > 0 &&  string.length < 6)
	{
		document.getElementById("password").style.backgroundColor = '#FF9999';
	}
	else
	{
		document.getElementById("password").style.backgroundColor = '#FFFFFF';
	}
}
	
	
function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if ((charCode == 32 || charCode == 40 || charCode == 41 || charCode == 43 || charCode == 8 || charCode==46 || charCode==38 || charCode==37) || (charCode > 47 && charCode < 58))
    return true;

    return false;
}

function isUsernameKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if ((charCode > 47 && charCode < 58) || (charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode == 32 || charCode == 8 || charCode==46 || charCode==38 || charCode==37))
    return true;

    return false;
}
	
	
function checkUser(user) {
	var x = false;
	try { x = new ActiveXObject('Msxml2.XMLHTTP'); }
	catch (e){
		try { x = new ActiveXObject('Microsoft.XMLHTTP'); }
		catch (E) { x = false;}
	}


	if (!x && typeof(XMLHttpRequest)!='undefined')
	{
		x = new XMLHttpRequest();
	}

	var  url = 'checker.php?username=' + user;
	x.open('GET', url, true);
	x.onreadystatechange = function()
	{
		if (x.readyState == 4)
		{
			var c = x.responseText;
			if (c == 1) 
			{ 
				document.getElementById("checkname").style.display = "block";
			}	
			else  document.getElementById('checkname').style.display = "none";
		}
	}
	x.send(null);
	return;
}

function showLogin()
{
	document.getElementById('loginBox').style.display = 'block';

}