// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
//
// NOTE THAT WE ARE USING jQUERY HERE! (not script.aculo.us, which is horrible)
$(document).ready(function() {
	menu_prep();
	category_highlight();
});
//highlight appropriate menu item
function menu_prep() {
	$("#sidebar a").hover(function(){
		var position = $(this).position();
		var leftpos = position.left - 28;
		var toppos = position.top + 8;
		$("#menu-arrow").css("margin-top","0px");
		$("#menu-arrow").css("left",leftpos);
		$("#menu-arrow").css("top",toppos);
	}, function(){
		$("#menu-arrow").css("margin-top","-1000px");
		$("#menu-arrow").css("left",0);
		$("#menu-arrow").css("top",0);
	});
}
//grab the first post's category and display the header class
function category_highlight(){
	var target_cat = $("div.category-hidden:first").text();
	if (target_cat.length > 1) {
		$("#category-img").removeClass();
		$("#category-img").addClass(target_cat);
	}
}

