var boton = 0;
function MostrarPagina(pagina,boton) {
	if (pagina == "/login.php") {
		cont = document.getElementById('contenido_login');
	} else {
		cont = document.getElementById('contenido');
	}
	boton = boton;
	
	ajax=Ajax();
	
    ajax.open("POST", pagina, true);
    ajax.onreadystatechange = function(){
	if (ajax.readyState==1) {
		if (pagina == "/login.php") {
		
		} else {
			document.getElementById('preloader_inicial').style.display='block';
			document.getElementById('contenido').style.display='none';
		}
	} else {
		//alert("ajax.readyState : " + ajax.readyState + " ; ajax.status : " + ajax.status);
		//alert("ajax.responseText : " + ajax.responseText);
		if (ajax.readyState == 4 && ajax.status == 200) {
		if (pagina == "/login.php") {
		
		} else {
			cont.innerHTML = ajax.responseText;
			document.getElementById('preloader_inicial').style.display='none';
			document.getElementById('contenido').style.display='block';
		}
		}
	}
	}
	ajax.send(null);
	//----------- configuraciones previas -------------//
	
	//definir los titulos de los botones
	titulo=new Array();
	titulo[0]="INGRESAR";
	titulo[1]="¿Cómo se juega?";
	titulo[2]="Políticas";
	titulo[3]="Premios";
	titulo[4]="Registrarme";
	
	//definir numero de botones
	nrobtn=5;
	
	//definir prefijo de botones
	//(esto con el objetivo de no tener
	//problemas al momento de validar
	//nuestra página.)
	pref="boton_";
	
	if (boton==1){
		//alert("boton : " + boton + " ; titulo : " + titulo[boton-1]);
		//document.getElementById('encabezado').style.display='none';
	} else {
		//alert("boton : " + boton + " ; titulo : " + titulo[boton-1]);
		//document.getElementById('encabezado').style.display='block';
		//document.getElementById('encabezado').innerHTML=titulo[boton-1];
	}
	
	//-------------------- fin ------------------------//

	//quita el estilo a todos los botones
	/*for(i=1;i<=nrobtn;i++){
		tit=titulo[i-1];
		btn=document.getElementById(pref+i);
		btn.innerHTML="<span style=\"border-top:1px #FF9900 solid; border-left:1px #FF9900 solid; border-right:1px #FF9900 solid;	border-bottom:1px #FF9900 solid; margin-left:5px; padding-left:2px;padding-right:2px; padding-top:1px; padding-bottom:1px; text-decoration:none; 	background-color:#FFFFCC;\">"+tit+"</span>";
	}*/
	//le da estilo al boton actual
	/*btnA = document.getElementById(pref+boton);
	tit=titulo[boton-1];
	btnA.innerHTML="<span style=\"border-top:1px #FF9900 solid;	border-left:1px #FF9900 solid; border-right:1px #FF9900 solid;	margin-left:5px; padding-left:2px;padding-right:2px; padding-top:1px; padding-bottom:5px; text-decoration:none; 	background-color:#FFCCCC;\">"+tit+"</span>";*/
}

function opcion_estado() {
	var pais = document.getElementById('pais');
	//alert("seleccionaste el pais : " + document.getElementById('pais').value);
	if (pais.value == 1) {
		document.getElementById('estado_0').style.display='none';
		document.getElementById('estado_1').style.display='block';
		document.getElementById('estado_2').style.display='none';
		document.getElementById('walmart').style.display='block';
	} else if (pais.value == 2) {
		document.getElementById('estado_0').style.display='none';
		document.getElementById('estado_1').style.display='none';
		document.getElementById('estado_2').style.display='block';
		document.getElementById('walmart').style.display='none';
	} else {
		document.getElementById('estado_0').style.display='block';
		document.getElementById('estado_1').style.display='none';
		document.getElementById('estado_2').style.display='none';
		document.getElementById('walmart').style.display='none';
	}
}

function mostrar_walmart_2() {
	document.getElementById('encuesta_walmart_2').style.display='block';
}

function ocultar_walmart_2() {
	document.getElementById('encuesta_walmart_2').style.display='none';
}

function opcion_walmart() {
	var acepta_walmart = document.getElementById('acepta_walmart');
	//alert("seleccionaste el pais : " + document.getElementById('pais').value);
	if (acepta_walmart.value == 1) {
		mostrar_walmart_2();
	} else if (acepta_walmart.value == 0) {
		ocultar_walmart_2();
	}
}

function registrar() {
	var email_original = document.getElementById('email_original');
	var password_original = document.getElementById('password_original');
	var password_confirmar = document.getElementById('password_confirmar');
	var nombre = document.getElementById('nombre');
	var apaterno = document.getElementById('apaterno');
	var amaterno = document.getElementById('amaterno');
	var pais = document.getElementById('pais');
	//var estado = document.getElementById('estado');
	var ciudad = document.getElementById('ciudad');
	var codigo_postal = document.getElementById('codigo_postal');
	var sexo = document.getElementById('sexo');
	var edo_civil = document.getElementById('edo_civil');
	var deporte_favorito = document.getElementById('deporte_favorito');
	var dia = document.getElementById('dia');
	var mes = document.getElementById('mes');
	var anio = document.getElementById('anio');
	var equipo = document.getElementById('equipo');
	var noticias_boletines = document.getElementById('noticias_boletines');
	var acepta_walmart = document.getElementById('acepta_walmart');
	//var acepta_walmart_radio = ChkRadio(document.formulario["acepta_walmart"]);
	var tienda_walmart = document.getElementById('tienda_walmart');
	var visita_walmart = document.getElementById('visita_walmart');
	var boletin_walmart = document.getElementById('boletin_walmart');
	
	/*for ( var i = 0; i < noticias.length; i++ ) {
		alert("opcion noticias : " + noticias[i].value);
		if ( noticias[i].checked ) {
			alert(noticias[i].value);
			//return true;
		}
	}*/
	//alert(noticias.value);
		
	if (email_original.value == "") {
		alert("Favor de Introducir una cuenta de Correo Electrónico.");
		email_original.focus();
		return false;
	}
	if (password_original.value == "") {
		alert("Favor de Introducir una Contraseña de Acceso.");
		password_original.focus();
		return false;
	}
	if (password_confirmar.value == "") {
		alert("Favor de Introducir la confirmación de Contraseña.");
		password_confirmar.focus();
		return false;
	}
	if (nombre.value == "") {
		alert("Favor de Introducir tu Nombre.");
		nombre.focus();
		return false;
	}
	if (apaterno.value == "") {
		alert("Favor de Introducir tu Apellido Paterno.");
		apaterno.focus();
		return false;
	}
	if (amaterno.value == "") {
		alert("Favor de Introducir tu Apellido Materno.");
		amaterno.focus();
		return false;
	}
	if (pais.value == "") {
		alert("Favor de Seleccionar un País.");
		pais.focus();
		return false;
	}
	if (pais.value == 1) {
		if (document.getElementById('estado1').value == "") {
			alert("Favor de Seleccionar un Estado.");
			document.getElementById('estado1').focus();
			return false;
		}
	} else if (pais.value == 2) {
		if (document.getElementById('estado2').value == "") {
			alert("Favor de Seleccionar un Estado.");
			document.getElementById('estado2').focus();
			return false;
		}		
	}
	if (ciudad.value == "") {
		alert("Favor de Introducir una Ciudad.");
		ciudad.focus();
		return false;
	}
	if (codigo_postal.value == "") {
		alert("Favor de Introducir el Código Postal.");
		codigo_postal.focus();
		return false;
	}
	if (sexo.value == "") {
		alert("Favor de Seleccionar tu Género.");
		sexo.focus();
		return false;
	}
	if (edo_civil.value == "") {
		alert("Favor de Seleccionar tu Estado Civil.");
		edo_civil.focus();
		return false;
	}
	if (deporte_favorito.value == "") {
		alert("Favor de Seleccionar tu Deporte favorito.");
		deporte_favorito.focus();
		return false;
	}
	if (dia.value == "") {
		alert("Favor de Seleccionar el Día en que naciste.");
		dia.focus();
		return false;
	}
	if (mes.value == "") {
		alert("Favor de Seleccionar el Mes en que naciste.");
		mes.focus();
		return false;
	}
	if (anio.value == "") {
		alert("Favor de Seleccionar el Año en que naciste.");
		anio.focus();
		return false;
	}
	if (equipo.value == "") {
		alert("Favor de Seleccionar un equipo.");
		equipo.focus();
		return false;
	}
	if (noticias_boletines.value == "") {
		alert("Favor de Seleccionar un opción de Boletín.");
		noticias_boletines.focus();
		return false;
	}
	if (acepta_walmart.value == "1") {
		if (tienda_walmart.value == "") {
			alert("Favor de Seleccionar un opción de Tienda Walmart.");
			tienda_walmart.focus();
			return false;
		}
		if (visita_walmart.value == "") {
			alert("Favor de Seleccionar un opción de Visita Walmart.");
			visita_walmart.focus();
			return false;
		}
	}
	
	if (pais.value == 1) {
		var estado = document.getElementById('estado1');
	} else if (pais.value == 2) {
		var estado = document.getElementById('estado2');
	} else {
		var estado = "0";
	}
	
	/*rep_nombre = nombre.value.replace("á","&#225;");
	rep_nombre = rep_nombre.replace("é","&#233;");
	rep_nombre = rep_nombre.replace("í","&#237;");
	rep_nombre = rep_nombre.replace("ó","&#237;");
	rep_nombre = rep_nombre.replace("ú","&#237;");
	rep_nombre = rep_nombre.replace("à","&#224;");
	rep_nombre = rep_nombre.replace("è","&#232;");
	rep_nombre = rep_nombre.replace("ì","&#236;");
	rep_nombre = rep_nombre.replace("ò","&#242;");
	rep_nombre = rep_nombre.replace("ù","&#249;");
	rep_nombre = rep_nombre.replace("Á","&#193;");
	rep_nombre = rep_nombre.replace("É","&#201;");
	rep_nombre = rep_nombre.replace("Í","&#205;");
	rep_nombre = rep_nombre.replace("Ó","&#211;");
	rep_nombre = rep_nombre.replace("Ú","&#218;");
	rep_nombre = rep_nombre.replace("Ñ","&#209;");
	rep_nombre = rep_nombre.replace("ñ","&#241;");
	rep_nombre = rep_nombre.replace("'","&#39;");
	rep_apaterno = apaterno.value.replace("á","&#225;");
	rep_apaterno = rep_apaterno.replace("é","&#233;");
	rep_apaterno = rep_apaterno.replace("í","&#237;");
	rep_apaterno = rep_apaterno.replace("ó","&#237;");
	rep_apaterno = rep_apaterno.replace("ú","&#237;");
	rep_apaterno = rep_apaterno.replace("à","&#224;");
	rep_apaterno = rep_apaterno.replace("è","&#232;");
	rep_apaterno = rep_apaterno.replace("ì","&#236;");
	rep_apaterno = rep_apaterno.replace("ò","&#242;");
	rep_apaterno = rep_apaterno.replace("ù","&#249;");
	rep_apaterno = rep_apaterno.replace("Á","&#193;");
	rep_apaterno = rep_apaterno.replace("É","&#201;");
	rep_apaterno = rep_apaterno.replace("Í","&#205;");
	rep_apaterno = rep_apaterno.replace("Ó","&#211;");
	rep_apaterno = rep_apaterno.replace("Ú","&#218;");
	rep_apaterno = rep_apaterno.replace("Ñ","&#209;");
	rep_apaterno = rep_apaterno.replace("ñ","&#241;");
	rep_apaterno = rep_apaterno.replace("'","&#39;");
	rep_amaterno = amaterno.value.replace("á","&#225;");
	rep_amaterno = rep_amaterno.replace("é","&#233;");
	rep_amaterno = rep_amaterno.replace("í","&#237;");
	rep_amaterno = rep_amaterno.replace("ó","&#237;");
	rep_amaterno = rep_amaterno.replace("ú","&#237;");
	rep_amaterno = rep_amaterno.replace("à","&#224;");
	rep_amaterno = rep_amaterno.replace("è","&#232;");
	rep_amaterno = rep_amaterno.replace("ì","&#236;");
	rep_amaterno = rep_amaterno.replace("ò","&#242;");
	rep_amaterno = rep_amaterno.replace("ù","&#249;");
	rep_amaterno = rep_amaterno.replace("Á","&#193;");
	rep_amaterno = rep_amaterno.replace("É","&#201;");
	rep_amaterno = rep_amaterno.replace("Í","&#205;");
	rep_amaterno = rep_amaterno.replace("Ó","&#211;");
	rep_amaterno = rep_amaterno.replace("Ú","&#218;");
	rep_amaterno = rep_amaterno.replace("Ñ","&#209;");
	rep_amaterno = rep_amaterno.replace("ñ","&#241;");
	rep_amaterno = rep_amaterno.replace("'","&#39;");
	rep_ciudad = ciudad.value.replace("á","&#225;");
	rep_ciudad = rep_ciudad.replace("é","&#233;");
	rep_ciudad = rep_ciudad.replace("í","&#237;");
	rep_ciudad = rep_ciudad.replace("ó","&#237;");
	rep_ciudad = rep_ciudad.replace("ú","&#237;");
	rep_ciudad = rep_ciudad.replace("à","&#224;");
	rep_ciudad = rep_ciudad.replace("è","&#232;");
	rep_ciudad = rep_ciudad.replace("ì","&#236;");
	rep_ciudad = rep_ciudad.replace("ò","&#242;");
	rep_ciudad = rep_ciudad.replace("ù","&#249;");
	rep_ciudad = rep_ciudad.replace("Á","&#193;");
	rep_ciudad = rep_ciudad.replace("É","&#201;");
	rep_ciudad = rep_ciudad.replace("Í","&#205;");
	rep_ciudad = rep_ciudad.replace("Ó","&#211;");
	rep_ciudad = rep_ciudad.replace("Ú","&#218;");
	rep_ciudad = rep_ciudad.replace("Ñ","&#209;");
	rep_ciudad = rep_ciudad.replace("ñ","&#241;");
	rep_ciudad = rep_ciudad.replace("'","&#39;");*/
	/*rep_nombre = nombre.value.replace("á","a");
	rep_nombre = rep_nombre.replace("é","e");
	rep_nombre = rep_nombre.replace("í","i");
	rep_nombre = rep_nombre.replace("ó","o");
	rep_nombre = rep_nombre.replace("ú","u");
	rep_nombre = rep_nombre.replace("à","a");
	rep_nombre = rep_nombre.replace("è","e");
	rep_nombre = rep_nombre.replace("ì","i");
	rep_nombre = rep_nombre.replace("ò","o");
	rep_nombre = rep_nombre.replace("ù","u");
	rep_nombre = rep_nombre.replace("Á","A");
	rep_nombre = rep_nombre.replace("É","E");
	rep_nombre = rep_nombre.replace("Í","I");
	rep_nombre = rep_nombre.replace("Ó","O");
	rep_nombre = rep_nombre.replace("Ú","U");
	rep_nombre = rep_nombre.replace("Ñ","N");
	rep_nombre = rep_nombre.replace("ñ","n");
	rep_apaterno = apaterno.value.replace("á","a");
	rep_apaterno = rep_apaterno.replace("é","e");
	rep_apaterno = rep_apaterno.replace("í","i");
	rep_apaterno = rep_apaterno.replace("ó","o");
	rep_apaterno = rep_apaterno.replace("ú","u");
	rep_apaterno = rep_apaterno.replace("à","a");
	rep_apaterno = rep_apaterno.replace("è","e");
	rep_apaterno = rep_apaterno.replace("ì","i");
	rep_apaterno = rep_apaterno.replace("ò","o");
	rep_apaterno = rep_apaterno.replace("ù","i");
	rep_apaterno = rep_apaterno.replace("Á","A");
	rep_apaterno = rep_apaterno.replace("É","E");
	rep_apaterno = rep_apaterno.replace("Í","I");
	rep_apaterno = rep_apaterno.replace("Ó","O");
	rep_apaterno = rep_apaterno.replace("Ú","U");
	rep_apaterno = rep_apaterno.replace("Ñ","N");
	rep_apaterno = rep_apaterno.replace("ñ","n");
	rep_amaterno = amaterno.value.replace("á","a");
	rep_amaterno = rep_amaterno.replace("é","e");
	rep_amaterno = rep_amaterno.replace("í","i");
	rep_amaterno = rep_amaterno.replace("ó","o");
	rep_amaterno = rep_amaterno.replace("ú","u");
	rep_amaterno = rep_amaterno.replace("à","a");
	rep_amaterno = rep_amaterno.replace("è","e");
	rep_amaterno = rep_amaterno.replace("ì","i");
	rep_amaterno = rep_amaterno.replace("ò","o");
	rep_amaterno = rep_amaterno.replace("ù","i");
	rep_amaterno = rep_amaterno.replace("Á","A");
	rep_amaterno = rep_amaterno.replace("É","E");
	rep_amaterno = rep_amaterno.replace("Í","I");
	rep_amaterno = rep_amaterno.replace("Ó","O");
	rep_amaterno = rep_amaterno.replace("Ú","U");
	rep_amaterno = rep_amaterno.replace("Ñ","N");
	rep_amaterno = rep_amaterno.replace("ñ","n");
	rep_ciudad = ciudad.value.replace("á","a");
	rep_ciudad = rep_ciudad.replace("é","e");
	rep_ciudad = rep_ciudad.replace("í","i");
	rep_ciudad = rep_ciudad.replace("ó","o");
	rep_ciudad = rep_ciudad.replace("ú","u");
	rep_ciudad = rep_ciudad.replace("à","a");
	rep_ciudad = rep_ciudad.replace("è","e");
	rep_ciudad = rep_ciudad.replace("ì","i");
	rep_ciudad = rep_ciudad.replace("ò","o");
	rep_ciudad = rep_ciudad.replace("ù","u");
	rep_ciudad = rep_ciudad.replace("Á","A");
	rep_ciudad = rep_ciudad.replace("É","E");
	rep_ciudad = rep_ciudad.replace("Í","I");
	rep_ciudad = rep_ciudad.replace("Ó","O");
	rep_ciudad = rep_ciudad.replace("Ú","U");
	rep_ciudad = rep_ciudad.replace("Ñ","N");
	rep_ciudad = rep_ciudad.replace("ñ","n");*/
	//alert(noticias.value);
	//alert("/cgi-bin/nuevo_registro.php?\r\naction=adduser&\r\nemail="+email_original.value+"&\r\npassword="+password_original.value+"&\r\npassword_confirmar="+password_confirmar.value+"&\r\nnombre="+nombre.value+"&\r\napaterno="+apaterno.value+"&\r\namaterno="+amaterno.value+"&\r\nciudad="+ciudad.value+"&\r\nestado="+estado.value+"&\r\ncodigo_postal="+codigo_postal.value+"&\r\nsexo="+sexo.value+"&\r\ndia="+dia.value+"&\r\nmes="+mes.value+"&\r\nanio="+anio.value+"&\r\nequipo="+equipo.value+"&\r\nnoticias="+noticias.value);
	ajax=Ajax();
	ajax.open("POST", "/cgi-bin/nuevo_registro.php?action=adduser&email="+email_original.value+"&password="+password_original.value+"&password_confirmar="+password_confirmar.value+"&nombre="+nombre.value+"&apaterno="+apaterno.value+"&amaterno="+amaterno.value+"&pais="+pais.value+"&estado="+estado.value+"&ciudad="+ciudad.value+"&codigo_postal="+codigo_postal.value+"&sexo="+sexo.value+"&edo_civil="+edo_civil.value+"&deporte_favorito="+deporte_favorito.value+"&dia="+dia.value+"&mes="+mes.value+"&anio="+anio.value+"&equipo="+equipo.value+"&noticias="+noticias_boletines.value+"&acepta_walmart="+acepta_walmart.value+"&tienda_walmart="+tienda_walmart.value+"&visita_walmart="+visita_walmart.value+"&boletin_walmart="+boletin_walmart.value, true);
	ajax.onreadystatechange=function() {
		//alert("readyState 2 : " + ajax.readyState);
		//alert("ajax.responseText : " + ajax.responseText);
	if (ajax.readyState==1) {
			document.getElementById('preloader_inicial').style.display='block';
			document.getElementById('contenido').style.display='none';
		} else if (ajax.readyState==4) {
			resultado = ajax.responseText.split('|');
			//alert("ajax.responseText : " + ajax.responseText);
			//alert("readyState 3 : " + ajax.readyState);
			if(resultado[1] == 1) { 
				alert("Favor de no dejar ninguna casilla del formulario vacía.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 2) { 
				alert("Favor de Introducir una cuenta de Correo Electrónico válida.");
				//document.getElementById('email_original').focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 3) { 
				alert("La Contraseña y la confirmación de la Contraseña no coinciden. Favor de verificar.");
				//document.getElementById('password_original').focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 4) { 
				alert("La cuenta de Correo Electrónico " + email_original.value + " ya se encuentra registrada.");
				//document.getElementById('email_original').focus();
				email_original.focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 6) {
				alert("Su Correo Electrónico " + email_original.value + " ha sido registrado con éxito.\r\nSe le ha enviado una clave de confirmación para que pueda participar en la Liga Fantástica.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
				//MostrarPagina('/confirmacion_de_email.php','30','Confirmación de Email');
				MostrarPagina('/lf5/confirmacion_de_email.php','30','');
			} else {
				//document.getElementById('procesando').style.display='none';
				top.location.href = "/";
			}//resultado
		}//estado
		
	}//ajax.onreadystatechange=function
	
	ajax.send(null)
	//form.submit();*/
	//}
	
}


function confirmar() {
	var email_confirmacion = document.getElementById('email_confirmacion');
	var clave_confirmacion = document.getElementById('clave_confirmacion');
	
	if (email_confirmacion.value == "") {
		alert("Favor de Introducir la cuenta de Correo Electrónico.");
		email_confirmacion.focus();
		false;
	} else if (clave_confirmacion.value == "") {
		alert("Favor de Introducir la clave de confirmación de Correo Electrónico.");
		clave_confirmacion.focus();
		false;
	} else {
	//alert("/cgi-bin/confirmar_email.php?\r\naction=confirmar&\r\nclave="+clave+"\r\n&email="+email);
	ajax=Ajax();
	ajax.open("POST", "/cgi-bin/confirmar_email.php?action=confirmar&email="+email_confirmacion.value+"&clave="+clave_confirmacion.value, true);
	ajax.onreadystatechange=function() {
		//alert("readyState 2 : " + ajax.readyState);
		//alert("ajax.responseText : " + ajax.responseText);
	if (ajax.readyState==1) {
			document.getElementById('preloader_inicial').style.display='block';
			document.getElementById('contenido').style.display='none';
		} else if (ajax.readyState==NORMAL_STATE) {
			resultado = ajax.responseText.split('|');
			//alert("ajax.responseText : " + ajax.responseText);
			//alert("readyState 3 : " + ajax.readyState);
			if(resultado[1] == 1) { 
				alert("Favor de no dejar ninguna casilla del formulario vacia.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 2) { 
				alert("Favor de Introducir una cuenta de Correo Electrónico válida.");
				//email.focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 3) { 
				alert("La cuenta de Correo Electrónico y la Clave de confirmación no coinciden. Favor de verificar.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 4) { 
				alert("La cuenta de Correo Electrónico " + email_confirmacion.value + " ya estaba confirmada.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 6) {
				//alert("Tu cuenta de Correo Electrónico '" + email_confirmacion.value + "' ha sido confirmada con éxito.\r\nBienvenido a la Liga Fantástica.");
				document.getElementById('preloader_inicial').style.display='block';
				document.getElementById('contenido').style.display='none';
				top.location.href = "/";
			} else {
				//document.getElementById('procesando').style.display='none';
				top.location.href = "/";
			}//resultado
		}//estado
		
	}//ajax.onreadystatechange=function
	
	ajax.send(null)
	//form.submit();
	}
	
}

function sendpassword() {
	var email_password = document.getElementById('email_password');
	
	if (email_password.value == "") {
		alert("Favor de Introducir la cuenta de Correo Electrónico.");
		email_password.focus();
		false;
	} else {
	//alert("/cgi-bin/send_password.php?\r\naction=sendpwd&\r\nemail_password="+email_password);
	ajax=Ajax();
	ajax.open("POST", "/cgi-bin/send_password.php?\r\naction=sendpwd&\r\nemail_password="+email_password.value, true);
	ajax.onreadystatechange=function() {
		//alert("readyState 2 : " + ajax.readyState);
		//alert("ajax.responseText : " + ajax.responseText);
	if (ajax.readyState==1) {
			document.getElementById('preloader_inicial').style.display='block';
			document.getElementById('contenido').style.display='none';
		} else if (ajax.readyState==NORMAL_STATE) {
			resultado = ajax.responseText.split('|');
			//alert("ajax.responseText : " + ajax.responseText);
			//alert("readyState 3 : " + ajax.readyState);
			if(resultado[1] == 1) { 
				alert("Favor de Introducir la cuenta de Correo Electrónico.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 2) { 
				alert("Favor de Introducir una cuenta de Correo Electrónico válida.");
				//document.getElementById('email_password').focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 3) { 
				top.location.href = "/";
			} else if(resultado[1] == 6) {
				alert("Se ha enviado la Contraseña al Correo Electrónico '" + email_password.value + "'.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
				//document.getElementById('email_password').value = '';
			} else {
				//document.getElementById('procesando').style.display='none';
				top.location.href = "/";
			}//resultado
		}//estado
		
	}//ajax.onreadystatechange=function
	
	ajax.send(null)
	//form.submit();
	}
	
}


function sendconfirmationagain() {
	var email_clave_confirmacion_solicitar = document.getElementById('email_clave_confirmacion_solicitar');
	
	if (email_clave_confirmacion_solicitar.value == "") {
		alert("Favor de Introducir la cuenta de Correo Electrónico.");
		email_clave_confirmacion_solicitar.focus();
		false;
	} else {
	//alert("/cgi-bin/send_password.php?\r\naction=sendpwd&\r\nemail_password="+email_password);
	ajax=Ajax();
	ajax.open("POST", "/cgi-bin/send_clave_confirmacion.php?\r\naction=sendcve&\r\nemail_clave_confirmacion_solicitar="+email_clave_confirmacion_solicitar.value, true);
	ajax.onreadystatechange=function() {
		//alert("readyState 2 : " + ajax.readyState);
		//alert("ajax.responseText : " + ajax.responseText);
	if (ajax.readyState==1) {
			document.getElementById('preloader_inicial').style.display='block';
			document.getElementById('contenido').style.display='none';
		} else if (ajax.readyState==NORMAL_STATE) {
			resultado = ajax.responseText.split('|');
			//alert("ajax.responseText : " + ajax.responseText);
			//alert("readyState 3 : " + ajax.readyState);
			if(resultado[1] == 1) { 
				alert("Favor de Introducir la cuenta de Correo Electrónico.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 2) { 
				alert("Favor de Introducir una cuenta de Correo Electrónico válida.");
				//document.getElementById('email_password').focus();
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
			} else if(resultado[1] == 3) { 
				top.location.href = "/";
			} else if(resultado[1] == 6) {
				alert("Se ha enviado la Clave de Confirmación al Correo Electrónico '" + email_clave_confirmacion_solicitar.value + "'.");
				document.getElementById('preloader_inicial').style.display='none';
				document.getElementById('contenido').style.display='block';
				MostrarPagina('confirmacion_de_email.php','30','Confirmaci&oacute;n de E-mail');
			} else {
				//document.getElementById('procesando').style.display='none';
				top.location.href = "/";
			}//resultado
		}//estado
		
	}//ajax.onreadystatechange=function
	
	ajax.send(null)
	//form.submit();
	}
	
}