var xmlhttp;

function enableButton(){
	if(document.form1.username.value!="123")
		document.getElementById(submit).disabled=false;
//		document.form1.submit.disabled=false;
	}

function showUser(username){
		if(username=='' || username.length<5 || username.length>15){
			document.form.submit.disabled=true;
			document.getElementById("textHint").innerHTML="Please type between 5-15 letters.";

			return;
		}else{
	document.form.submit.disabled=false;
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}


	var url="funcAjax.php";
	url=url+"?q="+username;
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
			}

}

function stateChanged(){
	if (xmlhttp.readyState==4){
		document.getElementById("textHint").innerHTML=xmlhttp.responseText;
	}
}

function GetXmlHttpObject(){
	if (window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject){
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}
