// expanding menu category 

jQuery(function() {
	jQuery("#categoriesTab").click(function() {
		jQuery('#choicefulCategories').slideDown('slow');
		addAutoHide("#choicefulCategories"); 
	});

	jQuery("#choicefulCategories #categoriesClose").click(function() {
		jQuery('#choicefulCategories').slideUp('slow');
	});
});

jQuery(function() {
	jQuery("#brandsTab").click(function() {
		jQuery('#choicefulBrands').slideDown('slow');
		addAutoHide("#choicefulBrands"); 
	});

	jQuery("#choicefulBrands #brandsClose").click(function() {
		jQuery('#choicefulBrands').slideUp('slow');
	});
});

function addAutoHide(element) {
	var t;
	
	jQuery(element).hover(function() {
		clearTimeout(t)
	}, function() {
		t = setTimeout(function() {jQuery(element).slideUp()}, 2000);
	});
}


// horizontal scroller

jQuery(function() {
	//jQuery("div.horizontalScroll").smoothDivScroll({scrollingSpeed: 5, mouseDownSpeedBooster: 3, visibleHotSpots: "always", autoScroll:"onstart", autoScrollDirection:"endlessloop"});
	jQuery(".horizontalScroll.autoScroll").smoothDivScroll({scrollingSpeed: 5, mouseDownSpeedBooster: 3, visibleHotSpots: "always", autoScroll: "always", autoScrollDirection: "backandforth", pauseAutoScroll: "mouseover", countOnlyClass: ".entry"});
});

