function updatePage() {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
    
    if (response == "0") {
    	$('respuesta').innerHTML = '<font color=green>Ese tag está disponible</font>';
    } 
    
    if (response == "1") {
    	$('respuesta').innerHTML = '<font color=red>Ese tag NO está disponible</font>';
    }
    
    if (response == "T") {
    	$('respuesta').innerHTML = '<font color=red>Ese tag NO es válido</font>';
    }
  }
}

function checktag() {
  var username = document.registro.username.value;
  var chars = username.length;
  
  if (chars <= 3) {
  	$('respuesta').innerHTML = 'Llena tu nombre de cuenta';
  	return;
  }
  
  var url = "call/username/?gtag=" + escape(username);
if (xmlHttp)
{
	xmlHttp.onreadystatechange = function () {}
	xmlHttp.abort();
}
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = updatePage;
	xmlHttp.send(null);
}