// Funcion utilizada para chequear los campos del formulario. Devuelve false si no 
// hubo error, y el componente erroneo si hubo error.
function formWithErrors() {
	for (var i = 0; i < this.elements.length; i++) {	
		// Si el elemento es un text, o un textarea, y tiene las tres propiedades adicionales 
		// necesarias para validar el componente; o si es un select, llamamos al metodo asociado a 
		// el para validarlo
		
		if (this.elements[i].type) {
			// Tenemos tipo para el elemento
			if ((this.elements[i].type.toUpperCase().indexOf('SELECT') != -1 && this.elements[i].type.toUpperCase().indexOf('SELECT-ONE') == -1) ||
				((this.elements[i].type.toUpperCase().indexOf('TEXT') != -1 ||
				this.elements[i].type.toUpperCase().indexOf('PASSWORD') != -1 ||
				this.elements[i].type.toUpperCase().indexOf('HIDDEN') != -1 ||
				this.elements[i].type.toUpperCase().indexOf('FILE') != -1) &&
				this.elements[i].storageType && this.elements[i].validate &&
				this.elements[i].maxStorageLength)) {
					if (!this.elements[i].validate()) {
						// El formulario tiene errores: devolvemos el elemento erroneo
					  return this.elements[i]; 
					}
			}
		}
	}
	return false; // El formulario no tiene errores
}
