var filters = {};
jQuery("ul.filter a").click(function() {
	$el = jQuery(this);
	var data = $el.attr("data-filter").split("_");
	
	/* set new active menu item */
	$el.parents('.filter').find('a').removeClass('active').filter($el).addClass('active');
	
	/* update filters */
	if( data[1] != '' ) {
		filters[data[0]] = data[1];
	}
	else {
		delete filters[data[0]];
	}
	
	/* hack - should be done in a general manner! */
	if (!filters.gender && !filters.theme) {
		// show all if filter is empty
		jQuery('#category-products').find('.shop_item').show();
	} else {
		$filteredshopitems = jQuery('#category-products').find('.shop_item').hide();  //clone( true );
		for( var i in filters ) {
			$filteredshopitems = $filteredshopitems.filter("[data-filter~='"+filters[i]+"']").show();
		}
	}
	
	scrollbar.tinyscrollbar_update();
	
	//rebuildList( $filteredshopitems );
	return false;
});

function rebuildList( $filteredshopitems ) {
	/*var	ipp = 12,
		pages = Math.ceil( $filteredshopitems.length/ipp ),
		$items;
	
	jQuery("#category-products .slideparent").html('');
	
	for( var i = 0 ; i < (pages*ipp) ; i+=ipp ) {
		$items = $filteredshopitems.filter(':eq('+i+'), :gt('+i+'):lt('+(i+ipp)+')');
		$items.show().appendTo("#category-products .slideparent").wrapAll('<li class="slidechild"></li>');
	}
	
	// TODO: Should reset the scrollbar
	Slider_reset();
	*/
	
	
}
