function regresarPpal() {
	document.location.href="paginaPrincipal.do";
}

function validarDatos(forma) {

	if (forma.nombre.value=="") {
		alert("Por favor escriba su nombre");
		forma.nombre.focus();
		return false;
	}

    if (forma.email.value=="") {
		alert("Usted debe ingresar su dirección de correo electrónico a fin de contactarlo.");
		forma.email.focus();
		return false;
	} else if (!isEmail(forma.email.value)) {
		alert("Ingrese un formato válido para su dirección de correo electrónico.");
		forma.email.focus();
		return false;
	}
	
	if (forma.preguntas.value=="none") {
		alert("Por favor seleccione una pregunta de contacto.");
		forma.preguntas.focus();
		return false;
	}else{
		if (forma.preguntas.value=="asunto_1"){
			if (forma.asunto_a.value == "none"){
				alert("Por favor seleccione un asunto.");
				forma.asunto_a.focus();
				return false;
			}
		} else{
			if (forma.asunto_b.value == "none"){
				alert("Por favor seleccione un asunto.");
				forma.asunto_b.focus();
				return false;
			}
		}
	}
           
	if (forma.pais.selectedIndex==0) {
		alert("Por favor seleccione un país.");
		forma.pais.focus();
		return false;
	}
	
	if (forma.mensaje.value=="") {
		alert("Por favor escriba el mensaje");
		forma.mensaje.focus();
		return false;
	}
	
	if (confirm("¿Está seguro de enviar este mensaje?")) {
		if (forma.mensaje.value.length>=1000) forma.mensaje.value = forma.mensaje.value.substring(0,999);
		forma.nombre.value = reemplazarAcentos(forma.nombre.value);
		forma.mensaje.value = reemplazarAcentos(forma.mensaje.value);
		
		forma.submit();
	} 
}

function VerOcultar(a)
{
	if (a == 'none')
	{
		document.getElementById('asunto_1').style.display = 'none';
		document.getElementById('asunto_2').style.display = 'none';
	}
	else
	{
		if (document.ContactenosB2C.preguntas.value == 'asunto_1')
		{
			a = 'asunto_1';
			vista=document.getElementById(a).style.display;
			if (vista=='none')
				vista='block';
			else
				vista='none';
	
			document.getElementById('asunto_2').style.display = 'none';
			document.getElementById(a).style.display = vista;
		}
		else
		{
			a = 'asunto_2';
			vista=document.getElementById(a).style.display;
			if (vista=='none')
				vista='block';
			else
				vista='none';

			document.getElementById('asunto_1').style.display = 'none';
			document.getElementById(a).style.display = vista;
		}
	}
}
