/**
 * Created by NeiroN on 02.11.2015.
 */
$(document).ready(function(){
    $("#tablinks a").click(function(e){
        e.preventDefault();
        $(this).tab('show');
    });

    $('#modalButton').click(function(){
        $('#modal').modal('show')
            .find('#modalContent')
            .load($(this).attr('value'));
        jQuery('#requisitesForm').yiiActiveForm(
            [{"id":"requisites-user_id","name":"user_id","container":".field-requisites-user_id","input":"#requisites-user_id","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"User ID\"."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"�������� \u0022User ID\u0022 �� ���� ����� ������.","skipOnEmpty":1});}},
                {"id":"requisites-account","name":"account","container":".field-requisites-account","input":"#requisites-account","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"������������� �������\"."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"�������� \u0022������������� �������\u0022 �� ���� ����� ������.","skipOnEmpty":1});}},
                {"id":"requisites-bank","name":"bank","container":".field-requisites-bank","input":"#requisites-bank","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"����\"."});yii.validation.string(value, messages, {"message":"�������� \"����\" �� ���� ��������� ������.","max":50,"tooLong":"�������� \"����\" ������� ������ �������� 50 �������.","skipOnEmpty":1});}},
                {"id":"requisites-city","name":"city","container":".field-requisites-city","input":"#requisites-city","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"̳���\"."});yii.validation.string(value, messages, {"message":"�������� \"̳���\" �� ���� ��������� ������.","max":20,"tooLong":"�������� \"̳���\" ������� ������ �������� 20 �������.","skipOnEmpty":1});}},
                {"id":"requisites-mfo","name":"mfo","container":".field-requisites-mfo","input":"#requisites-mfo","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"���\"."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"�������� \u0022���\u0022 �� ���� ����� ������.","skipOnEmpty":1});}},
                {"id":"requisites-zkpo","name":"zkpo","container":".field-requisites-zkpo","input":"#requisites-zkpo","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"��������� ��������� \"����\"."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"�������� \u0022����\u0022 �� ���� ����� ������.","skipOnEmpty":1});}}], []);
    });
});
