function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function usr_disponible(){
	
	divValido = document.getElementById('valido');		//donde se mostrará el resultado
	ajax = objetoAjax();									//instanciamos el objetoAjax
	nombre_usr = document.QForm.nickname.value;

	ajax.open("POST", "contenidos/es/seleccion_personal/comprueba_usr.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divValido.innerHTML = ajax.responseText;   
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//enviando los valores
 	ajax.send("nickname="+nombre_usr);	
}