/* [ ---- Gebo Admin Panel - validation ---- ] */

	$(document).ready(function() {
		//* regular validation
		gebo_validation.reg();
		
	});
	
	//* validation
	gebo_validation = {
        reg: function() {
            reg_validator = $('.form_validation_reg').validate({
				onkeyup: false,
				errorClass: 'error',
				validClass: 'valid',
				highlight: function(element) {
					$(element).closest('div').addClass("f_error");
				},
				unhighlight: function(element) {
					$(element).closest('div').removeClass("f_error");
				},
                errorPlacement: function(error, element) {
                    $(element).closest('div').append(error);
                },
                rules: {
					mydate: { required: true, minlength: 2 },
					title: { required: true, minlength: 1 },
					category: { required: true, minlength: 0 },
					qnty: { required: true, minlength: 1 },
					unitprice: { required: true, minlength: 1 },
					amount: { required: true, minlength: 1 }
				},
                invalidHandler: function(form, validator) {
					$.sticky("There are some errors. Please corect them and submit again.", {autoclose : 5000, position: "top-right", type: "st-error" });
				}
            })
        }
	};