var $j = jQuery;
$j(document).ready(function () {
							 
$j("ul#term li:not(:last)").append(", ");							 

// Random CSS 
	// Remove right border divider line from last (right-most) nav item
	$j("#anav li:last-child a, #fnav li:last-child a").css({
		"border-right" : "none",
		"margin-right" : "0",
		"padding-right" : "0"
		});
	
	// Stuff for left side navigation
	$j("#snav li:last-child a").css("background","none");
	
	// Remove background image from "Home" link in breadcrumbs
	$j("#breadcrumb li:first-child a").css({
		"background":"url(/wp-content/themes/usability-first/images/icon-crumbs-home.png) no-repeat 0px 11px", // update this path once go live
		"padding-left":"24px"
		});
	
	// Do stuff to last/first item in list
	$j("#letters li:last-child").css("margin-right","0");
	$j("#breadcrumb li:last-child").addClass("current-crumb");

	
	// Remove bottom border from sidebar nav
	$j("body#sidebar-right #sidebar li:last").css("border-bottom","none");
	$j("#snav li:last").css("background","none");
	
	// List/table striping
	$j("body#home #recent-job-postings ul li:odd").addClass("alt");
	$j("body#jobs #job-listings li:odd").addClass("alt");

	
	// Sidebar subnav styles
	$j("#sidebar ul#snav li").wrapInner("<div></div>");
	//$j("#sidebar ul#snav li.current_page_item div").wrapInner("<span></span>");
	
	// Style file browse form field
	$j("input[type=file]").filestyle({ 
		 image: "/wp-content/themes/usability-first/images/btn-browse.png", // update this path once go live
		 imagewidth : 81,
		 imageheight : 33,
		 width : 350
	 	});
	
	$j("#job-listings li p.location-type").each(function() {
		var $types = $j(this).find('em')
		$types.filter(":not(:last)").append(", ");
		});
	
	// "What's this?" Tooltip
	$j("#whats-this").qtip({
		content: '<p><b>What is this thing?</b><br />As a deterrent to spam submissions, we have implemented a logic puzzle. In order to submit this form, you need to provide the correct answer to the question.</p>'
		});
	
}); // End of document
	
// For IE - So that :focus for forms changes its look
$j(document).ready(function(){
	$j("input, textarea").addClass("idle");
		$j("input, textarea").focus(function(){
			$j(this).addClass("hasfocus").removeClass("idle");
	}).blur(function(){
			$j(this).removeClass("hasfocus").addClass("idle");
	});
});
