	var isIE = navigator.userAgent.indexOf("MSIE")!=-1
	var isGecko = navigator.userAgent.indexOf("Gecko")!=-1

	function checkForm(){
		var elements = document.forms[0].elements
		//Comprobación de longitudes mínimas en las cajas de texto
		for(var i=0;i<elements.length;i++){
			var e = elements[i]
			if((e.type && e.type=="text") || e.tagName=="SELECT"){
				var minlength = e.getAttribute("minlength")
				var textval = e.value
				var description = e.getAttribute("description") ? e.getAttribute("description") : e.id
				var format = e.getAttribute("format")
				if(minlength && textval.length<parseInt(minlength)){
					if(e.tagName=="SELECT")
						alert("Por favor, seleccione algún valor de \"" + description + "\"")
					else
						alert("El campo \"" + description + "\" no tiene la longitud apropiada")
					e.focus()
					return false;
				}
				if(format){
					var re = new RegExp("^" + format + "$","gim")
					if(!re.test(textval)){
						alert("El campo \"" + description + "\" no tiene el formato correcto")
						e.focus()
						return false;
					}
				}
			}
		}
	}
