$(function(){
	$("#blog_widget .label").click(function(){
		var id = "widget_" + $(this).attr("id");
		$("#" + id).slideToggle();
	});
	$("#widget_bw1").slideDown("slow",function(){
		$("#widget_bw2").slideDown("slow");
	});
	$("#searchbox").focus(function(){
		if ($(this).val() == "search...")
		{
			$(this).val("");
		}
	});
	$("#searchbox").blur(function(){
		if ($(this).val() == "")
		{
			$(this).val("search...");
		}
	});

	var splash_btns_keys = {
		"s_atelier" : 0,
		"s_gallery" : 1,
		"s_about" : 2
	};
	var splash_btns_fx = function(o, x, y){
		var cname = o.attr("className");
		if (cname.indexOf("current") == -1)
		{
			o.stop();
			o.animate({backgroundPosition: x + "px " + y + "px"}, "1000");
		}
	}
	$("#toolbar .button").click(function(){
		$("#toolbar .button.current").not($(this)).each(function(i){
			$(this).removeClass("current");
			$(this).trigger("mouseout");
			var padid = "#" + this.id + "_pad";
			$(padid).stop();
			$(padid).fadeOut("fast");
		});
		$(this).addClass("current");
		var padid = "#" + $(this).attr("id") + "_pad";
		$(padid).stop();
		$(padid).fadeIn("slow");
	});
	$("#toolbar .button").hover(
		function(){
			splash_btns_fx($(this), -100, splash_btns_keys[$(this).attr("id")] * -50);
		},
		function(){
			splash_btns_fx($(this), 0, splash_btns_keys[$(this).attr("id")] * -50);
		}
	);
});