$(function() {
    $("#career_form").validate({
        rules: {
            'career[title]': {
                required: true,
                minlength: 2,
                maxlength: 50
            },
            'career[name]': {
                required: true,
                minlength: 4,
                maxlength: 50
            },
            'career[email]': {
                required: true,
                email: true,
                minlength: 4,
                maxlength: 50
            },
            'career[position]': {
                required: true,
                minlength: 2,
                maxlength: 50
            },
            'career[phone]': {
                required: true,
                minlength: 4,
                maxlength: 50
            }
        },
        messages: {
            'career[title]': {
                required: "Title is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'career[name]': {
                required: "The name is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'career[position]': {
                required: "Position is blank",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'career[email]': {
                required: "The e-mail is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'career[phone]': {
                required: "The phone is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            }
        }
    });



    $("#contact_form").validate({
        rules: {
            'contact[name]': {
                required: true,
                minlength: 4,
                maxlength: 50
            },
            'contact[email]': {
                required: true,
                email: true,
                minlength: 4,
                maxlength: 50
            },
            'contact[message]': {
                required: true,
                minlength: 2,
                maxlength: 1000
            },
            'contact[phone]': {
                required: true,
                minlength: 4,
                maxlength: 50
            }
        },
        messages: {
            'contact[name]': {
                required: "The name is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'contact[message]': {
                required: "Message is blank",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'contact[email]': {
                required: "The e-mail is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            },
            'contact[phone]': {
                required: "The phone is blank.",
                minlength: "Too short.",
                maxlength: "Too long."
            }
        }
    });



});