$(function(){
	$b = $.browser
	
	$("#toc li.cat a")
	.each(function(i){ $.extend(this, {section: $("#"+this.id.split("_")[0])}); })
	.not(".selected")
		.each(function(i){ this.section.hide(); })
	.end()
	.hover(function() {
		$(this).filter(":not(.selected)")
		.filterIE6only().css({background: "0"}).end()
		.animate({left: "5px"}, 100)
	}, function() {
		$(this).filter(":not(.selected)").animate({left: "0"}, 100)
	})
	.click(function(e) {
		e.preventDefault();
		
		$("#categories li.cat").hide();
		this.section.fadeIn();
		$("a.selected").removeClass("selected").css({left: "0"});
		$(this).addClass("selected");
		$.scrollTo(this.section, 600);
	});
	
	$("h4 a.totop").remove();
	$("a.totop").click(function(e){ 
		e.preventDefault();
		$.scrollTo(0, 400);
	});
	$('ul.brands a').click(function(e){
		if (window.open(this.href)) {
			e.preventDefault();
		} else { if (window.location(this.href)){e.preventDefault();} }
	})
	.filterIE6out()
		.find("span").hide()
		.end()
		.hover(
			function() {
			$(this).find("span").filter(":not(:animated)")
				.animate({height: "show", opacity: "show", left: "+=4px"}, 120, "easeInQuad")
				.animate({opacity: 1.0}, 3000);
			},
			function() {
				$(this).find("span").filter(":visible")
				.animate({height: "hide", opacity: "hide", left: "0"}, 120, "easeInQuad");
			});
});


