/*  Aljamir Software, S.L.
	Funciones auxiliares varias
*/
var valido;
var indiceVectorErrores;
var errores;
var separadorCampos = '$@';
var separadorLineas = '#&';

function iniciaVariables () {
	valido = true;
	indiceVectorErrores = 0;
	errores = new Array();
}

function mostrarErrores (errores) {
	var cadenaTextoErrores = "";
	
	for (i = 0; i < errores.length; i++) {
		cadenaTextoErrores += errores[i] + ".\n";
	} 
	alert (cadenaTextoErrores);
}

function validaFormLogin(){
	iniciaVariables();
	var i=0;
	
	if (document.forms.frmLogin.eMail.value.length < 4){
		valido = false;
		errores[indiceVectorErrores] = "Introduzca su Login";
		document.forms.frmLogin.eMail.select();
		indiceVectorErrores++;
	}
	if (document.forms.frmLogin.clave.value.length < 6){
		valido = false;
		errores[indiceVectorErrores] = "Introduzca su clave";
		document.forms.frmLogin.clave.select();
		indiceVectorErrores++;
	}


	if (valido) {
		return true;
	} else {
		mostrarErrores(errores);
		return false;
	}
	
}
