$(document).ready(function() {
	$(".second ul").css("display", "none");
	$("#online_shop").css("display", "none");
	if (window.location.hash.length > 1) {
		$("#online_shop").css("display", "block");
		$(window.location.hash + "-loc").next().slideDown(500);
		$(".main a").each(function() {
			var href = $(this).attr("href");
			$(this).attr("href", href + window.location.hash)
		});
	}
	
	$("#shop_online").click(function(e) {
		if ($(this).next().css("display") == "none") {
			$(this).next().slideDown(500);
		} else {
			$(this).next().slideUp(500);
		}
		return false;
	});
	
	$(".second a").click(function(e) {
		if ($(this).next().css("display") == "none") {
			$(this).next().slideDown(500);
		} else {
			$(this).next().slideUp(500);
		}
		if (!$(this).parent.hasClass("third"));
		return false;
	});
	
	$("a.breadcrumb").click(function(e) {
		e.preventDefault();
		hash = window.location.hash.split("#");
		hash = hash[1];
		window.location.hash = "#" + hash;
		$("#" + hash + "-loc").next().slideDown(500);
	});
	
	$("#creative_lab").css("display", "none");
	$("#creative_lab_link").click(function(e) {
		if ($(this).next().css("display") == "none") {
			$(this).next().slideDown(500);
		} else {
			$(this).next().slideUp(500);
		}
		return false;
	});
});
