//<SCRIPT LANGUAGE="JAVASCRIPT">

//	Contiene las funciones de validación utilizadas en 
//	en las validaciones de formularios.
	
	function isEmptyTextArea(campo) {
		if ((campo.value.length == 0)||(campo == null)) {
			return true;
		}	
		else {
			return false;
		}	
	}
	
	function isEmpty(s)	{  
		return ((s == null) || (s.length == 0))
	}
	
	function isDigit (c) {   
		return ((c >= "0") && (c <= "9"))
	}  
	
	function isInteger (s) {   
		var i;

    if (isEmpty(s)) 
			if (isInteger.arguments.length == 1) 
				return false;
			else 
				return (isInteger.arguments[1] == true);
	    
	    for (i = 0; i < s.length; i++) {   
				var c = s.charAt(i);
        if( i != 0 ) {
            if (!isDigit(c)) return false;
        } else { 
            if (!isDigit(c) && (c != "-") || (c == "+")) return false;
        }
	    }
	    return true; 
	}
	
	function contador (campo, cuentacampo, limite) {
		if (campo.value.length > limite) campo.value = campo.value.substring(0, limite);
		else cuentacampo.value = limite - campo.value.length;

	}
	
//</SCRIPT>

