function ajaxFunction() {
var xmlHttp;
	try{
		xmlHttp=new XMLHttpRequest();
		return xmlHttp;
	}catch(e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			return xmlHttp;
		}catch(e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				return xmlHttp;
			}catch(e){
				alert("Tu navegador no soporta AJAX!");
				return false;
			}
		}
	}
}
//======================================================================================
//======================================================================================
function letra(){
	t=window.event.keyCode
	if((t>=65 && t<=90) || (t>=97 && t<=122) || t==32 || t==241 || t==209){
	}else{
		alert("Solo letras y Espacios")
		window.event.keyCode = 0;
	}
}
//======================================================================================
//======================================================================================
function numero(){
	t=window.event.keyCode
	if((t>=48 && t<=57) || t==46){
	}else{
		alert("Solo Numeros")
		window.event.keyCode = 0;
	}
}
//======================================================================================
//======================================================================================
function CountLeft(field, count, max) {
if (field.value.length > max)
field.value = field.value.substring(0, max);
else
count.value = max - field.value.length;
}
//=====================================================================================
//=====================================================================================
function validar(){
	re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/;
	nom = document.form1.nombre.value;
	mail = document.form1.email.value;
	dni = document.form1.dni.value;
	dis = document.form1.distrito.value;
	his = document.form1.historia.value;
	reco = document.form1.recomendado.value;

	if(nom == ""){alert("Ingrese sus Nombres.");document.form1.nombre.focus();}
	else if(mail == ""){alert("Ingrese su e-mail.");document.form1.email.focus();}
	else if(dni == ""){alert("Ingrese su numero de DNI.");document.form1.dni.focus();}
	else if(reco == ""){alert("Ingrese un correo de sus amigos(as).");}
	else if(!re.exec(mail)){alert("Formato de e-mail no valido.");document.form1.email.focus();}
	else{
		document.forms["form1"].submit();
	}
}

//=====================================================================================
//=====================================================================================
