$(document).ready(function(){var sort = $('.product-filter .sort select');var limit = $('.product-filter .limit select');sort.removeAttr('onchange');limit.removeAttr('onchange');$(sort).change(function(){var href = $(this).find('option:selected').val();$.ajax({url: 'index.php?route=module/filter_cat/parceUrl',type: 'post',data: 'url=' + encodeURIComponent(href),dataType: 'json',success: function(json) { changeOption(json);} });return false;} );$(limit).change(function(){var href = $(this).find('option:selected').val();$.ajax({url: 'index.php?route=module/filter_cat/parceUrl',type: 'post',data: 'url=' + encodeURIComponent(href),dataType: 'json',success: function(json) { changeOption(json);} });return false;} );$('.pagination a').live('click', function(){var href = $(this).attr('href');$.ajax({url: 'index.php?route=module/filter_cat/parceUrl',type: 'post',data: 'url=' + encodeURIComponent(href),dataType: 'json',success: function(json) { changeOption(json);} });return false;});});function insertProducts(json){if(!json['result']['error']){$('.product-grid').html(json['result']['grid']);$('.product-list').html(json['result']['list']);$('.pagination').html(json['pagination']);} else {$('.product-grid').html(json['result']['error']);$('.product-list').html(json['result']['error']);$('.pagination').html('');}}