// JavaScript Document
function nuevoAjax(){
	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 obtener_regions(ID){
	var id, contenedor;
	contenedor = document.getElementById('regiones');
	id =ID;
	ajax=nuevoAjax();
	ajax.open("GET", "gen_regiones.php?id="+id,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.send(null)
}

function obtener_regions2(ID){
	var id, contenedor;
	contenedor = document.getElementById('regiones2');
	id =ID;
	ajax=nuevoAjax();
	ajax.open("GET", "gen_regiones2.php?id="+id,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.send(null)
}

function verificar_username(ID,lengua){
	var id, contenedor, len;
	contenedor = document.getElementById('username1');
	contenedor.innerHTML ="loading...";
	id =ID;
	len=lengua;
	ajax=nuevoAjax();
	ajax.open("GET", "ver_username.php?id="+id+"&len="+len,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText;
	 	}
	}
	ajax.send(null)
}

function verificar_mail(ID,lengua){
	var id, contenedor, len;
	contenedor = document.getElementById('email1');
	id =ID;
		contenedor.innerHTML ="loading...";
		len=lengua;
		ajax=nuevoAjax();
		ajax.open("GET", "ver_username.php?mail="+id+"&len="+len,true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
			}
		}
		ajax.send(null)
}


function recordarme(lengua){
	var id, contenedor, len;
	contenedor = document.getElementById('recordarme');
		len=lengua;
		ajax=nuevoAjax();
		ajax.open("GET", "recordar.php?len="+len,true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
			}
		}
		ajax.send(null)
}
