//Event.observe(window, 'load', init);

document.observe("dom:loaded", init_validation);

function init_validation() {
	new Validation('contact_form');
	
	Validation.add('class-name', 'Este campo s&oacute;lo admite letras y espacios', {
		pattern: new RegExp("^[a-zA-Z ñÑ.áéíóúÁÉÍÓÚàèìòùÀÈÌÒÙüÜ]*$")
	});
	
	Validation.add('class-tel', 'El tel&eacute;lefono no es v&aacute;lido. Escriba s&oacute;lo n&uacute;meros sin espacios.', {
		 pattern : new RegExp("^[0-9]{9,12}$"),
	    // minLength : 9, // value must be at least 6 characters
	     maxLength : 12, // value must be no longer than 13 characters
	     include : ['validate-digits'] // also tests each validator included in this array of validator keys (there are no sanity checks so beware infinite loops!)
	});
	
}
