/*
 * Inline Form Validation Engine 1.7, jQuery plugin
 * 
 * Copyright(c) 2010, Cedric Dugas
 * http://www.position-relative.net
 *	
 * Form validation engine allowing custom regex rules to be added.
 * Thanks to Francois Duquette and Teddy Limousin 
 * and everyone helping me find bugs on the forum
 * Licenced under the MIT Licence
 */
(function($) {
	$.fn.validationEngineLanguage = function() {};
	$.validationEngineLanguage = {
		newLang: function() {
			$.validationEngineLanguage.allRules = 	{"required":{    			// Add your regex rules here, you can take telephone as an example
						"regex":"none",
						"alertText":"* campo obbligatorio",
						"alertTextCheckboxMultiple":"* selezionare un aopzione",
						"alertTextCheckboxe":"* check obbligatorio"},
					"length":{
						"regex":"none",
						"alertText":"* tra ",
						"alertText2":" e ",
						"alertText3": " caratteri richiesti"},
					"maxCheckbox":{
						"regex":"none",
						"alertText":"* Checks allowed Exceeded"},	
					"minCheckbox":{
						"regex":"none",
						"alertText":"* selezionare, prego ",
						"alertText2":" opzioni"},	
					"confirm":{
						"regex":"none",
						"alertText":"* i campi non coincidono"},
					"telephone":{
						"regex":"/^[0-9\-\(\)\ ]+$/",
						"alertText":"* numero telefonico non valido"},	
					"user":{
						"regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+\.[a-zA-Z0-9]{2,4}$/",
						"alertText":"* username non valido"},
					"email":{
						"regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+\.[a-zA-Z0-9]{2,4}$/",
						"alertText":"* indirizzo mail non valido"},	
					"date":{
                         "regex":"/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
                         "alertText":"* Invalid date, must be in YYYY-MM-DD format"},
					"onlyNumber":{
						"regex":"/^[0-9\ ]+$/",
						"alertText":"* solo numeri"},	
					"noSpecialCaracters":{
						"regex":"/^[0-9a-zA-Z\,\'\ ]+$/",
						"alertText":"* non sono ammessi caratteri speciali"},	
					"ajaxUser":{
						"file":"validateUser.php",
						"extraData":"name=eric",
						"alertTextOk":"* nome utente disponibile",	
						"alertTextLoad":"* attendere, prego...",
						"alertText":"* nome utente non disponibile"},	
					"ajaxName":{
						"file":"validateUser.php",
						"alertText":"* This name is already taken",
						"alertTextOk":"* This name is available",	
						"alertTextLoad":"* Loading, please wait"},		
					"onlyLetter":{
						"regex":"/^[a-zA-Z\ \']+$/",
						"alertText":"* solo lettere"},
					"validate2fields":{
    					"nname":"validate2fields",
    					"alertText":"* e' necessario inserire nome e cognome"},
					"validatecfpiva":{
    					"nname":"validatecfpiva",
    					"alertText":"* e' necessario inserire o CF o P.IVA"}	
					}	
					
		}
	}
})(jQuery);

$(document).ready(function() {	
	$.validationEngineLanguage.newLang()
});
