function Enviar(idCMSIdioma){
	idCMSIdioma = typeof(idCMSIdioma) != "undefined" ? idCMSIdioma : 1;

	var StrError = '';
	var strClave = new String(document.frmPrincipal.clave.value);
		
		if (!StrError && document.frmPrincipal.email.value == ""){
			StrError = StrError + "Por favor, llena el campo Email.\n";
			document.frmPrincipal.email.focus();
		}
		
		if (!StrError && !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmPrincipal.email.value))){
			StrError = StrError + "El email no tiene un formato valido.\n";
			document.frmPrincipal.email.focus();
		}
		
		if (!StrError && document.frmPrincipal.usuario.value == ""){
			StrError = StrError + "Por favor, llena el campo Nombre de Usuario.\n";
			document.frmPrincipal.usuario.focus();
		}
		if ((document.frmPrincipal.terminos.value != "chk") ||
        (document.frmPrincipal.terminos.value == "chk" && document.frmPrincipal.clave.value != "")) {
      if (!StrError && document.frmPrincipal.clave.value == ""){
        StrError = StrError + "Por favor, llena el campo Contraseña.\n";
        document.frmPrincipal.clave.focus();
      }

      if (!StrError && document.frmPrincipal.confirmacion.value == ""){
        StrError = StrError + "Por favor, llena el campo Confirmar contraseña.\n";
        document.frmPrincipal.confirmacion.focus();
      }

      if (!StrError && (document.frmPrincipal.clave.value != document.frmPrincipal.confirmacion.value)){
        StrError = StrError + "Las contraseñas no coinciden.\n";
        document.frmPrincipal.clave.value = "";
        document.frmPrincipal.confirmacion.value = "";
        document.frmPrincipal.clave.focus();
      }
    }
 

		if (!StrError && (document.frmPrincipal.terminos.checked == false && document.frmPrincipal.terminos.value != "chk")){
			StrError = StrError + "Acepte los términos y condiciones para registarse.\n";
			document.frmPrincipal.terminos.focus();
		}
		
		/*
		if (!StrError && document.frmPrincipal.nombre.value == ""){
			StrError = StrError + "Por favor, ingrese su Nombre.\n";
			document.frmPrincipal.nombre.focus();
		}
		if (!StrError && document.frmPrincipal.apellidoPaterno.value == ""){
			StrError = StrError + "Por favor, ingrese su Apellido Paterno.\n";
			document.frmPrincipal.apellidoPaterno.focus();
		}
		
		
		if (!StrError && document.frmPrincipal["sexo"].selectedIndex == 0){
			StrError = StrError + "Por favor, seleccione su Sexo.\n";
			document.frmPrincipal["sexo"].focus();
		}
		if (!StrError && (document.frmPrincipal.nac_dia.value == ""  || document.frmPrincipal.nac_dia.value == 0)){
			StrError = StrError + "Por favor, ingrese el dia de su Fecha de Nacimiento.\n";
			document.frmPrincipal.nac_dia.focus();
		}
		if (!StrError && (document.frmPrincipal.nac_mes.value == ""  || document.frmPrincipal.nac_mes.value == 0)){
			StrError = StrError + "Por favor, ingrese el mes de su Fecha de Nacimiento.\n";
			document.frmPrincipal.nac_mes.focus();			
		}
		if (!StrError && (document.frmPrincipal.nac_anio.value == "" || document.frmPrincipal.nac_anio.value == 0)){
			StrError = StrError + "Por favor, ingrese el año de su Fecha de Nacimiento.\n";
			document.frmPrincipal.nac_anio.focus();
		}
		if (!StrError && document.frmPrincipal["nacionalidad"].selectedIndex == 0){
			StrError = StrError + "Por favor, seleccione una Nacionalidad.\n";
			document.frmPrincipal["nacionalidad"].focus();			
		}
		if (!StrError && document.frmPrincipal["residencia"].selectedIndex == 0){
			StrError = StrError + "Por favor, seleccione un País.\n";
			document.frmPrincipal["residencia"].focus();
		}
		*/
	if(StrError != ''){
		alert(StrError);
	} else {
		document.frmPrincipal.submit();
	}
}

function solapasSwitch(){
	if(document.getElementById('misDatos').style.display == 'block'){
		document.getElementById('misAvisos').style.display ='block';
		document.getElementById('misDatos').style.display ='none';
		document.getElementById('misAvisosLI').className ='inactive pointer bluetext';
		document.getElementById('misDatosLI').className ='active pointer';
	} else {
		document.getElementById('misAvisos').style.display='none';
		document.getElementById('misDatos').style.display='block';
		document.getElementById('misAvisosLI').className ='active pointer';
		document.getElementById('misDatosLI').className ='inactive pointer bluetext';
	}
}

