$(document).ready(function() {
	$("ul.topnav li").mouseleave(function() {
		$(this).css("background-color","");
		$(this).find("a").css("color","#9b2a09");
		$(this).find("ul.subnav").find("a").css("color","#000000");
		$(this).find("ul.subnav").slideUp('fast');
	});
	$("ul.topnav li").mouseenter(function() {
		$(this).css("background-color","#bb4826");
		$(this).find("a").css("color","#000000");
		$(this).find("ul.subnav").slideDown('fast').show();
		$(this).hover(function() { }, function() { $(this).find("ul.subnav").slideUp('fast'); });
	});
	$("ul.subnav li").mouseenter(function() { 
		$(this).css("background-color","#d96948");
	});
	$("ul.subnav li").mouseleave(function() { 
		$(this).css("background-color","#bb4826");
		$(this).find("a").css("color","#000000");
	});
	$("div.sidebar_item_page").mouseenter(function() { 
		$(this).css("cursor","pointer");
		$(this).find(".sb_arrow_over").css('visibility','visible');
	});
	$("div.sidebar_item_page").mouseleave(function() { 
		$(this).find(".sb_arrow_over").css('visibility','hidden');
	});
	$("div.sidebar_item_page").click(function() { 
		var pg = $(this).find(".title").html();
		switch (pg) {
			case "ORDER":
				window.location.href = "https://app.etapestry.com/cart/WindowInternationalNetwork/default/index.php";
				break;
			case "SUBSCRIBE":
				window.location.href = "subscribe.php";
				break;
			case "DONATE":
				//window.location.href = "https://app.etapestry.com/cart/WindowInternationalNetwork/default/category.php?ref=3355.0.19187719";
				window.location.href = "https://app.etapestry.com/hosted/WindowInternationalNetwork/OnlineDonation.html";
				break;
			case "READ":
				window.location.href = "posts.php?cat=Reporter";
				break;
		}
	});	
});