// jQuery smoothScroll
jQuery(function() {
	jQuery("a[href^=#]").click(function() {
		var scrollTarget = this.hash;
		var $target = jQuery(scrollTarget == "#header" ? "body" : scrollTarget);
		if($target.size()) {
			jQuery.scrollTo($target, 800, { easing:"swing" });
		}
		return false;
	});
});

// jQuery openCloseMenu
jQuery(function() {
	var catDrinks = jQuery.cookie("catDrinks");
	var catSupplements = jQuery.cookie("catSupplements");
	var catOthers = jQuery.cookie("catOthers");
	if(!catDrinks) { catDrinks = "close"; }
	if(!catSupplements) { catSupplements = "close"; }
	if(!catOthers) { catOthers = "close"; }
	if(catDrinks == "close") { jQuery("#catDrinks").next().css("display", "none"); }
	if(catSupplements == "close") { jQuery("#catSupplements").next().css("display", "none"); }
	if(catOthers == "close") { jQuery("#catOthers").next().css("display", "none"); }
	jQuery("#catDrinks").addClass(catDrinks);
	jQuery("#catSupplements").addClass(catSupplements);
	jQuery("#catOthers").addClass(catOthers);
});

jQuery(function() {
	jQuery("a.categories").click(function() {
		jQuery(this).next().slideToggle("800");
		var changeId = jQuery(this).attr("id");
		var changeClass = jQuery(this).attr("class");
		if(changeClass.match("open")) {
			jQuery(this).removeClass("open");
			jQuery(this).addClass("close");
			jQuery.cookie(changeId, "close", {expires:30,path:'/'});
		} else {
			jQuery(this).removeClass("close");
			jQuery(this).addClass("open");
			jQuery.cookie(changeId, "open", {expires:30,path:'/'});
		}
	});
});

// jQuery lightBox
jQuery(function() { jQuery("a.lightBox").lightBox(); });

// jQuery listTable
jQuery(function() { jQuery(".listTable tr:even").addClass("even"); });

// jQuery current
jQuery( function() {
	jQuery("#navigation a").each(function() {
		var docPath = document.URL.split("#");
		if(this == docPath[0] || this + "index.html" == docPath[0]) {
			$(this).addClass("current");
		}
	});
});

