function estaVacio(campo, etiqueta) {
	if (campo.value.length == 0) {
		alert("Required field (" + etiqueta.toUpperCase() + ") should be filled");
		campo.focus();
		return true;
	}
	return false;
}
//-noNumerico-//Estas funciones comprueban si el campo es numérico
function noNumerico(campo, etiqueta) {
	if (!esNum(campo.value)) {
		alert("Warning: the field " + etiqueta.toUpperCase() + " must contain numbers only.");
		campo.focus();
		return true;
	}
	return false;
}
function esNum(dato){
	var numchars=0;
	var vabien=true;
	var subdato;
	
		numchars=eval(dato.length);
		for (var c=0;c<numchars;c++){
			subdato = dato.substring(c,c + 1);
			if (esNumero(subdato)==false) {
				vabien = false;
			}
		}
		return(vabien);
}
function esNumero(d){
	if ((d!='0') && (d!='1') && (d!='2') && (d!='3') && (d!='4') && (d!='5') &&
		(d!='6') && (d!='7') && (d!='8') && (d!='9')) {
		return false;
	}else{
		return true;
	}
}
//Esta función comprueba si es una dirección valida
function noEsMail(campo, etiqueta) {
	var sArroba=/^(.+)@(.+)$/;
	if (campo.value.match(sArroba)==null) {
		alert("ERROR: Incorrect field (" + etiqueta.toUpperCase() + ").");
		campo.focus();
		return true;
	}	
	var sPunto=campo.value.match(sArroba)[2];
	var iPunto=sPunto.length;
	var encontrado=0;
	for (i=0;i<iPunto;i++) {
		if (sPunto.charAt(i)==".") {
			encontrado = 1;
		}
	}
	if (!encontrado) {
		alert("ERROR: Incorrect field (" + etiqueta.toUpperCase() + ").");
		campo.focus();
		return true;
	}
	return false;
}

