$(document).ready(function(){
	$(".font-smaller").click(function(){
		$("#content").css('font-size','.75em');
	});
	$(".font-normal").click(function(){
		$("#content").css('font-size','1em');
	});
	$(".font-larger").click(function(){
		$("#content").css('font-size','1.4em');
	});
	
	$("form#searchform input#s").focus(function(){
		$(this).css('background', 'url(/wp-content/themes/tma/images/search-sidebar.png) no-repeat');
	});
	
	$("#nav ul li:not(.current_page_item):not(.current_page_ancestor) ul").hide();
	$("#nav ul li ul:visible").parent("li").addClass("parent").prepend('<img src="/wp-content/themes/tma/images/nav-arrow-on-down.png" />');
	$("#nav ul li ul:hidden").parent("li").addClass("parent").prepend('<img src="/wp-content/themes/tma/images/nav-arrow-off.png" />');
	
	$("#nav ul li img").click(function(){
		if($(this).parent("li").children("ul").is(':hidden')){
			$(this).parent("li").children("ul").slideDown();
			$(this).parent("li").children("img").attr("src","/wp-content/themes/tma/images/nav-arrow-on-down.png");
		}else{
			$(this).parent("li").children("ul").slideUp();
			$(this).parent("li").children("img").attr("src","/wp-content/themes/tma/images/nav-arrow-off.png");
		}
	});
	
	$(".post:last").css("border-bottom","none");
	
	$("#home-nav ul li").click(function(){
		$(this).children("ul").slideDown("fast");
		// return false;
	});
	$("#home-nav ul li").hover(
		function(){
			
		},
		function(){
			$(this).children("ul").slideUp("fast");
		}
	);
});
