$(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");
	});

	$(".tab").mouseenter(function() {
		$(this).stop();
		$(this).css("cursor","pointer");
		$(this).animate({right:"30"},250);
		$("#"+$(this).attr("id")+"_arrow").fadeIn(100);
	});
	$(".tab").mouseleave(function() {
		$(this).stop();
		$(this).animate({right:"0"},250);
		$("#"+$(this).attr("id")+"_arrow").delay(150).fadeOut(100);
	});
	$(".tab").click(function() {
		var pg = $(this).attr("id");
		switch (pg) {
		case "order":
			document.location = "http://win1040.com/resources.php";
			break;
		case "subscribe":
			document.location = "http://win1040.com/subscribe.php";
			break;
		case "donate":
			document.location = "https://win1040.com/donate.php";
			break;
		case "read":
			var rd = "http://win1040.com/reporter.php";
			document.location = rd;
			break;
		case "pray":
			document.location = "http://win1040.com/praying_through_the_window_9.php";
			break;
		}
	});
});
