	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" || e.tagName=="TEXTAREA"){
				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;
					}
				}
			}
		}

		//Comprobación de checkboxes
		if(!isChecked(elements["identidadexistente[]"])){
			alert("Por favor, indíquenos los elementos de Identidad existentes")
			elements["identidadexistente[]"][0].focus()
			return false
		}
		if(!isChecked(elements["remitidos[]"])){
			alert("Por favor, indíquenos los elementos de Comunicación que nos remitirá")
			elements["remitidos[]"][0].focus()
			return false
		} else {
			return true;
		}
	}

	function isChecked(radio){
		for(var i=0;i<radio.length;i++)
			if(radio[i].checked)
				return true
		return false
	}