function ValidarLogin(){
	var sFormulario=document.forms["loginForm"];
	if (sFormulario.elements["email"].value.length < 1 || sFormulario.elements["clave"].value.length < 1) {
		document.getElementById('msgLogin').innerHTML = "<span style='color:red'>El email y/o clave no pueden estar vac&iacute;os</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href='recordar.asp' target='_top'>Olvidó su Contraseña...?</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='socios_registro_form.asp' target='_top'>Reg&iacute;strarse en Sogarmef</a>";
		return false;
	}
	else {
		return true;
	}
}
function ValidarLogin2(){
	var sFormulario=document.forms["loginForm2"];
	if (sFormulario.elements["email"].value.length < 1 || sFormulario.elements["clave"].value.length < 1) {
		document.getElementById('msgLogin2').innerHTML = "<span style='color:red'>El email y/o clave no pueden estar vac&iacute;os</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href='recordar.asp' target='_top'>Olvidó su Contraseña...?</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='socios_registro_form.asp' target='_top'>Reg&iacute;strarse en Sogarmef</a>";
		return false;
	}
	else {
		return true;
	}
}
function ValidarRecordar(){
	var sFormulario=document.forms["recordarForm"];
	if (sFormulario.elements["email"].value.length < 1) {
		document.getElementById('msgRecordar').innerHTML = "<span style='color:red'>Debe especificar una cuenta de correo v&aacute;lida</span>";
		return false;
	}
	else {
		return true;
	}
}
function ValidarContacto(){
	var sFormulario=document.forms["formContacto"];
	var bOK = false;
	if (sFormulario.elements["txtNombre"].value.length > 0 && sFormulario.elements["txtEmail"].value.length > 0 && sFormulario.elements["txtComentario"].value.length > 0) {
		if (sFormulario.elements["chkLOPD"].checked) 
			bOK = true;
		else
			alert("Para enviar el formulario es necesario que acepte las condiciones de uso y la politica de privacidad de Sogarmef");
	}
	if (! bOK)
		document.getElementById('msgContacto').style.display = "block";
	return bOK;
}
function ValidarSocio(){
	var sFormulario=document.forms["formSocio"];
	var bOK = false;
	if (sFormulario.elements["txtNombre"].value.length > 0 && sFormulario.elements["txtApellidos"].value.length > 0 && sFormulario.elements["txtTfno"].value.length > 0 && sFormulario.elements["txtEmail"].value.length > 0 && sFormulario.elements["txtPass"].value.length > 0 && sFormulario.elements["txtPass2"].value.length > 0) {
		if (sFormulario.elements["chkLOPD"].checked) 
			bOK = true;
		else
			alert("Para enviar el formulario es necesario que acepte las condiciones de uso y la politica de privacidad de Sogarmef");
	}
	if (! bOK)
		document.getElementById('msgError').style.display = "block";
	else
		document.getElementById('msgError').style.display = "none";
	if (sFormulario.elements["txtPass"].value != sFormulario.elements["txtPass2"].value) {
		document.getElementById('msgPass').style.display = "block";
		bOK = false;
	}
	return bOK;
}
function ValidarBiblioteca(){
	var sFormulario=document.forms["formulario"];
	var bOK = false;
	if (sFormulario.elements["txtTitulo"].value.length>0 && sFormulario.elements["fichero"].value.length>0 && sFormulario.elements["cbCategoria"].value.length>0)
		bOK = true;
	else
		document.getElementById('msgError').style.display = "block";
	return bOK;
}
function ValidarTemas(){
	var sFormulario=document.forms["formTema"];
	var bOK = false;
	if (sFormulario.elements["txtTema"].value.length > 0) 
		bOK = true;
	else
		alert("El campo Tema no puede estar vacio");
	return bOK;
}

function NoComillas(e) { 
   tecla = (document.all) ? e.keyCode : e.which;
   if (tecla!=39) return true;
   patron = /\d/;
   teclaChar = String.fromCharCode(tecla);
   return patron.test(teclaChar);
}  
