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 cargarContenido(){
	var t1, t2, t3,t4 ,contenedor;
	contenedor = document.getElementById('contacto');
	t1 = document.getElementById('nombre_c').value;
	t2 = document.getElementById('motivo').value;
	t3 = document.getElementById('mail').value;
	t4 = document.getElementById('comentario').value;
	
	ajax=nuevoAjax();
	ajax.open("POST", "guardar_mensaje.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("nombre_c="+t1+"&motivo="+t2+"&mail="+t3+"&comentario="+t4);
}

function identifica(){
	var t1, t2, contenedor;

	contenedor = document.getElementById('bienvenido');
	t1 = document.getElementById('usuario').value;
	t2 = document.getElementById('pass').value;
	
	ajax=nuevoAjax();
	ajax.open("POST", "identificate.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("usuario="+t1+"&pass="+t2);
}
function identifica2(){
	var t1, t2, contenedor;

	contenedor = document.getElementById('bienvenido');
	t1 = document.getElementById('usuario').value;
	t2 = document.getElementById('pass').value;
	
	ajax=nuevoAjax();
	ajax.open("POST", "identificate2.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("usuario="+t1+"&pass="+t2);
}
function nuevo_usuario(){
	var t1, t2, contenedor;

	contenedor = document.getElementById('bienvenido');
	t1 = document.getElementById('usuario').value;
	t2 = document.getElementById('pass').value;
	
	ajax=nuevoAjax();
	ajax.open("POST", "identificate.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("usuario="+t1+"&pass="+t2);
}
function comprueba_user(usuario){
	var t1, contenedor;
	contenedor = document.getElementById('usuario_uso');
	t1 = usuario.value;
	ajax=nuevoAjax();
	ajax.open("POST", "comprueba_user.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("usuario="+t1);
}

function comprueba_user2(){
	var t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,contenedor;
	t1 = document.getElementById('user').value;
	t2 = document.getElementById('pass').value;
	t3 = document.getElementById('nombre').value;
	t4 = document.getElementById('apellidos').value;
	t5 = document.getElementById('direccion').value;
	t6 = document.getElementById('cp').value;
	t7 = document.getElementById('poblacion').value;
	t8 = document.getElementById('provincia').value;
	t9 = document.getElementById('tlf').value;
	t10 = document.getElementById('mail').value;
	contenedor = document.getElementById('resultado_alta');
	
	
	ajax=nuevoAjax();
	ajax.open("POST", "alta_user.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("user="+t1+"&pass="+t2+"&nombre="+t3+"&ape="+t4+"&dire="+t5+"&cp="+t6+"&pob="+t7+"&prov="+t8+"&tlf="+t9+"&mail="+t10);
}

function gracias(){
	var t1,t2,contenedor;
	t1 = document.getElementById('user').value;
	t3 = document.getElementById('aceptar').value;
	contenedor = document.getElementById('resultado_compra');
	
	
	ajax=nuevoAjax();
	ajax.open("POST", "gracias.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("user="+t1+"&aceptar="+t2);
}

function modifica(){
	var t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,contenedor;
	t1 = document.getElementById('user').value;
	t3 = document.getElementById('nombre').value;
	t4 = document.getElementById('apellidos').value;
	t5 = document.getElementById('direccion').value;
	t6 = document.getElementById('cp').value;
	t7 = document.getElementById('poblacion').value;
	t8 = document.getElementById('provincia').value;
	t9 = document.getElementById('tlf').value;
	t10 = document.getElementById('mail').value;
	contenedor = document.getElementById('resultado_cambio');
	
	
	ajax=nuevoAjax();
	ajax.open("POST", "cambia_user.asp",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("user="+t1+"&pass="+t2+"&nombre="+t3+"&ape="+t4+"&dire="+t5+"&cp="+t6+"&pob="+t7+"&prov="+t8+"&tlf="+t9+"&mail="+t10);
}

