(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": "* T&auml;m&auml; tieto tarvitaan.",
                    "alertTextCheckboxMultiple": "* Valitse",
                    "alertTextCheckboxe": "* T&auml;m&auml; valinta on pakollinen"
                },
                "minSize": {
                    "regex": "none",
                    "alertText": "* V&auml;hint&auml;&auml;n ",
                    "alertText2": " merkki&auml;"
                },
                "maxSize": {
                    "regex": "none",
                    "alertText": "* Vain ",
                    "alertText2": " merkki&auml;"
                },
                "min": {
                    "regex": "none",
                    "alertText": "* Minimiarvo on "
                },
                "max": {
                    "regex": "none",
                    "alertText": "* Maksimiarvo on "
                },
                "past": {
                    "regex": "none",
                    "alertText": "* Valitse pvm ennen "
                },
                "future": {
                    "regex": "none",
                    "alertText": "* Valitse pvm j&auml;lkeen "
                },	
                "maxCheckbox": {
                    "regex": "none",
                    "alertText": "* Valintoja on liikaa"
                },
                "minCheckbox": {
                    "regex": "none",
                    "alertText": "* Valitse v&auml;hint&auml;&auml;n ",
                    "alertText2": " kpl."
                },
                "equals": {
                    "regex": "none",
                    "alertText": "* Kent&auml;t eiv&auml;t t&auml;sm&auml;&auml;"
                },
                "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": "* Puhelinumero v&auml;&auml;rin."
                },
                "email": {
                    // Simplified, was not working in the Iphone browser
                    "regex": /^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/,
                    "alertText": "* Email v&auml;&auml;rin."
                },
                "integer": {
                    "regex": /^[\-\+]?\d+$/,
                    "alertText": "* Kokonaisluku"
                },
                "number": {
                    // Number, including positive, negative, and floating decimal. credit: orefalo
                    "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
                    "alertText": "* Desimaaliluku"
                },
                "date": {
                    // Date in ISO format. Credit: bassistance
                    "regex": /^\d{2}[\/\-]\d{1,2}[\/\-]\d{4}$/,
                    "alertText": "* Sy&ouml;t&auml; pvm muodossa pp-kk-vvvv."
                },
                "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": "* IP"
                },
                "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"
                },
                "onlyNumberSp": {
                    "regex": /^[0-9\ ]+$/,
                    "alertText": "* Vain numeroita"
                },
                "onlyLetterSp": {
                    "regex": /^[a-zA-Z\ \']+$/,
                    "alertText": "* Vain kirjaimia"
                },
                "onlyLetterNumber": {
                    "regex": /^[0-9a-zA-Z]+$/,
                    "alertText": "* Ei erikoismerkkej&auml;"
                },
                // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
                "ajaxUserCheck": {
                    "url": "index.php/ajax/user_exists/",
                    // you may want to pass extra data on the ajax call
                    "alertTextLoad": "* Tarkistetaan k&auml;ytt&auml;j&auml;nimi ... ",
                    "alertText": "* K&auml;ytt&auml;j&auml;nimi varattu.",
                    "alertTextOk": "* K&auml;ytt&auml;j&auml;nimi vapaa."
                },
                "ajaxNameCall": {
                    // remote json service location
                    "url": "index.php/ajax/user_exists/",
                    // 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"
                },
                "validate2fields": {
                    "alertText": "* Please input HELLO"
                }
            };
            
        }
    };
    $.validationEngineLanguage.newLang();
})(jQuery);


