 $(document).ready(function() {
                          
     $(".prod_row .cart").each(function(){
        var iid = $(this).attr('id'); 
        
        $(this).click(function(){
            var arr = {};
            arr[iid] = 1;
           $.post('index.php', {cart:arr,add_prod:1} ,function(data) {
                 document.location.href = '/?catalog.html?show=cart'; 
           }); 
        });

     });
     
     
     $(".price_block .small_cart").click(function(){
        var iid = $(this).attr('id'); 
        var count = $(".price_block #prod_count").val();
        if(!count || count <=0) count = 1;

        var arr = {};
        arr[iid] = count;
         $.post('index.php', {cart:arr,add_prod:1} ,function(data) {
                 document.location.href = '/?catalog.html?show=cart'; 
           }); 
     });
     
     
     
  //  $(document).ready(function(){
        $("#orderForm").validate();
  //  });
     
  //  $(document).ready(function(){
        $("#feed_form").validate({
            submitHandler: function(form) {
                    var id = $(form).attr('id');        
                    var code = $("#"+id+" #code").val();
                    
                    if(code){
                        
                        $.post('/scripts/feedback.php',{ code: code , type: 'check' } , function(data) {

                            res = $.parseJSON(data);
                                if(res.result) form.submit();
                                    else alert('Не верто ввелипроверочный код');
                        });
                        
                    }else alert('Введите код рповерки');
                        
                }
            });
   // }); 
     
         
      $("#cont_tabs").tabs();    
         
         
 });
