(function($){$.fn.popularGoods=function(options){var defaults={},settings=jQuery.extend(defaults,options);var obj=this;return this.click(function(event){var isActive=$(this).hasClass("active");var sender=$(this);obj.find("a").attr('href','javascript:void(0)');if(isActive){sender.children('a').attr('href',sender.children(':hidden').val());}
obj.removeClass("active");$(this).addClass("active");var cat_id=$(this).attr("id");var where_block=cat_id+'-sub';var isEmpty=$("#"+cat_id+"-sub:empty").size();$(".product_block").hide();if(isEmpty){$.post(GLOBAL_DIR+"/modules/goods/db_mtg_ajax.php",{cat_id:cat_id},function(data){$("#"+where_block).html(data);jQuery('#'+cat_id+'-sub-sl').scrollable({circular:true,mousewheel:true}).navigator().autoscroll({interval:10000});},"html");}
$("#"+where_block).show();});};})(jQuery);jQuery(document).ready(function($){$("ul#main-cat li").popularGoods();$("#mbanner").scrollable({circular:true,mousewheel:false}).navigator().autoscroll({interval:15000});var act_tab=$("ul#main-cat li.active");if(act_tab){var cat_id=$(act_tab).attr("id");var where_block=cat_id+'-sub';var isEmpty=$("#"+cat_id+"-sub:empty").size();if(isEmpty){$.post(GLOBAL_DIR+"/modules/goods/db_mtg_ajax.php",{cat_id:cat_id},function(data){$("#"+where_block).html(data);jQuery('#'+cat_id+'-sub-sl').scrollable({circular:true,mousewheel:true}).navigator().autoscroll({interval:10000});},"html");}
$("#"+where_block).show();}});
