var http = createRequestObject();
function createRequestObject() {
	var xmlhttp;
	try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e) {
		try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch(f) { xmlhttp=null; }
	}
	if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
		xmlhttp=new XMLHttpRequest();
	}
	return  xmlhttp;
}
function doCheck() {
	full_nick = encodeURIComponent(document.getElementById("id_mess").value);
	if (full_nick == '' || full_nick == 'Yahoo!%20ID') {
		alert('Trebuie sa intoduci un ID!');
	}
	else {
		http.open('POST',  'verifica.php');
		document.getElementById("result").innerHTML="<img src='images/loader.gif'>";
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponse;
		http.send('id_mess='+full_nick);
	}
	return false;
}
function handleResponse() {
	try {
		if((http.readyState == 4)&&(http.status == 200)){
			response = http.responseText;
			document.getElementById('result').innerHTML = ''+response+'';
		}
  	}
	catch(e){}
	finally{}
}
