(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 obligatorio",
                    "alertTextCheckboxMultiple": "* Por favor seleccione una opci\u00F3n",
                    "alertTextCheckboxe": "* Debe marcar uno"
                },
                "minSize": {
                    "regex": "none",
                    "alertText": "* Minimo ",
                    "alertText2": " caracteres permitidos"
                },
                "maxSize": {
                    "regex": "none",
                    "alertText": "* Maximum ",
                    "alertText2": " caracteres permitidos"
                },
                "min": {
                    "regex": "none",
                    "alertText": "* Minimo valor es "
                },
                "max": {
                    "regex": "none",
                    "alertText": "* Maximo valor es "
                },
                "past": {
                    "regex": "none",
                    "alertText": "* Fecha anterior "
                },
                "future": {
                    "regex": "none",
                    "alertText": "* Fecha posterior "
                },
                "maxCheckbox": {
                    "regex": "none",
                    "alertText": "* Demasiados campos marcados"
                },
                "minCheckbox": {
                    "regex": "none",
                    "alertText": "* Por favor seleccione ",
                    "alertText2": " opciones"
                },
                "equals": {
                    "regex": "none",
                    "alertText": "* Campos no coinciden"
                },
                "phone": {
                    // credit: jquery.h5validate.js / orefalo
                    "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
                    "alertText": "* Numero de telefono incorrecto"
                },
                "email": {
                    // Simplified, was not working in the Iphone browser
                    "regex": /^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/,
                    "alertText": "* Direcci\u00F3n de email incorrecta"
                },
                "integer": {
                    "regex": /^[\-\+]?\d+$/,
                    "alertText": "* Entero no v\u00E1lido"
                },
                "number": {
                    // Number, including positive, negative, and floating decimal. credit: orefalo
                    "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
                    "alertText": "* Número real no v\u00E1lido"
                },
                "date": {
                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
                    "alertText": "* Fecha incorrecta, debe ser de formato YYYY-MM-DD"
                },
                "ipv4": {
                    "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
                    "alertText": "* Direcci\u00F3n IP incorrecta"
                },
                "url": {
                    "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,
                    "alertText": "* URL incorrecta"
                },
                "onlyNumberSp": {
                    "regex": /^[0-9\ ]+$/,
                    "alertText": "* S\u00F3lo números"
                },
                "onlyLetterSp": {
                    "regex": /^[a-zA-Z\ \']+$/,
                    "alertText": "* Letters only"
                },
                "onlyLetterNumber": {
                    "regex": /^[0-9a-zA-Z]+$/,
                    "alertText": "* No special characters allowed"
                },
                // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
                "ajaxUserCall": {
                    "url": "ajaxValidateFieldUser",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    "alertText": "* This user is already taken",
                    "alertTextLoad": "* Validating, please wait"
                },
		"ajaxUserCallPhp": {
                    "url": "phpajax/ajaxValidateFieldUser.php",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* This username is available",
                    "alertText": "* This user is already taken",
                    "alertTextLoad": "* Validating, please wait"
                },
                "ajaxEmail": {
                    "url": "includes/validarUsuario.php",
                    // you may want to pass extra data on the ajax call
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* \u00C9ste usuario est\u00E1 disponible",
                    "alertText": "* \u00C9ste usuario ya est\u00E1 escogido",
                    "alertTextLoad": "* Validando, por favor espere"
                },                
                "ajaxEmailForo": {
                    "url": "includes/validarEmailForo.php",
                    // you may want to pass extra data on the ajax call
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* \u00C9ste correo est\u00E1 disponible",
                    "alertText": "* \u00C9ste correo ya est\u00E1 escogido",
                    "alertTextLoad": "* Validando, por favor espere"
                },                                
                "ajaxNick": {
                    "url": "includes/validarNick.php",
                    // you may want to pass extra data on the ajax call
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* \u00C9ste usuario est\u00E1 disponible",
                    "alertText": "* \u00C9ste usuario ya est\u00E1 escogido",
                    "alertTextLoad": "* Validando, por favor espere"
                },
                "ajaxUsuario": {
                    "url": "includes/validarUsuario.php",
                    // you may want to pass extra data on the ajax call
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* \u00C9ste usuario est\u00E1 disponible",
                    "alertText": "* \u00C9ste usuario ya est\u00E1 escogido",
                    "alertTextLoad": "* Validando, por favor espere"
                },
                "ajaxCaptcha": {
                    "url": "catcha/ver_validacionJQUERY.php",
                    // you may want to pass extra data on the ajax call
                    "extraData": "_imagevalidate="+_val_img,
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "Texto de validaci\u00F3n correcto",
                    "alertText": "* Texto de validaci\u00F3n incorrecto",
                    "alertTextLoad": "* Validando, por favor espere"
                },
                "ajaxNameCall": {
                    // remote json service location
                    "url": "ajaxValidateFieldName",
                    // error
                    "alertText": "* This name is already taken",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* This name is available",
                    // speaks by itself
                    "alertTextLoad": "* Validating, please wait"
                },
		"ajaxNameCallPhp": {
	                    // remote json service location
	                    "url": "phpajax/ajaxValidateFieldName.php",
	                    // error
	                    "alertText": "* This name is already taken",
	                    // speaks by itself
	                    "alertTextLoad": "* Validating, please wait"
	                },
                "validate2fields": {
                    "alertText": "* Please input HELLO"
                },
                "validateEmail": {
                    "alertText": "\u00C9ste usuario ya est\u00E1 escogido",
                     "alertTextOk": "\u00C9ste usuario est\u00E1 disponible",
                     "alertTextLoad": "* Validando, por favor espere",
                     "alertSinAviso": ""
                }

            };

        }
    };
    $.validationEngineLanguage.newLang();
})(jQuery);
