$(document).ready(function() {
	
	// show background only for active button. css sets background for all, js will hide it for all but active
	$("#header li").not($("#header li.active")).css("background","none");
	
/*	$("#categories_selector li > ul").hide();
	
	$("#categories_selector li a").click(function(){

		$(this).addClass("book"); // highlight the current branch opened
		$("#categories_selector li").not($(this).parents("li")).find("a").removeClass("book"); // unhighlight the other branchesdu

		$(this).parent().find("ul").first().slideToggle(); // finds any <ul> under the same <li> as current <a> clicked and toggles visibility
		
		$(this).parent().parent().find("li").not($(this).parent()).find("ul").slideUp(); //uff this one closes other branches on the same level when user clicks a new one 
		
		if($(this).parent().find("ul").length != 0) { // if there is any <ul> under this <li>
			return false; // prevent following the link (just open the tree branch)
		} 
	});*/
	
	$(".close").click(function(){
		$(this).parent().slideUp();
	});
	
	$("#sort").hide();
	
	$("#sort_button").click(function(){
		$("#sort").slideToggle();
	})

	$("#filter").hide();
	
	$("#filter_button").click(function(){
		$("#filter").slideToggle();
		$("#sort").hide();
	})
	
	if (navigator.userAgent.indexOf("Win")>=0) {
		$("#header li").css("padding","0 !important");
		//console.log("Windows");
	}	
});
