/* Author: 

*/

function cssFixes() {
	
	var browserVersion = $.browser.version * 1; //Convert IE version to number
	
	try {
		//Nav bg manipulation for active items
		if(!$("#nav li:last-child").hasClass("active")) {
			$("#nav li:last-child").addClass("noBg");
		}
		$("#nav li").each(function(el) {
			if($(this).hasClass("active")) {
				$(this).prev().addClass("noBg");
			}
		});
		
		// Since not all browsers support advanced selectors
		if($.browser.msie && browserVersion <= 7) {
			$(".donation ul li:first-child").css("border-top", "none");
			$(".donation ul li:last-child").css("border-bottom", "none");
			$(".article:first-child").css("margin-right", "30px");
			$(".director:first-child").css("margin-right", "20px");
		}
	} catch(e) {  }
}

/*
 * imgDropShadows
 * Wrap certain images with mark-up to allow for drop-shadow styling
*
function imgDropShadows() {
	imgID = $(".img");
	imgID.each(function(e) {
		alert($(this).css("width"));
		if($(this).css("width") < "150px") {
			$(this).wrap("<div class='imgWrapSml' style='width:" + $(this).css("width") +"'><div class='imgWrap'></div></div>");
		}
		else {
			$(this).wrap("<div class='imgWrapLrg' style='width:" + $(this).css("width") +";'><div class='imgWrap'></div></div>");	
		}
	});
}*/

$(document).ready(function() {
						   
	var current = $("ul#nav").find(".highlighted");
	
	//Find parent LI of nested UL, and apply highlighted class
	if(!current.parent("ul").attr("id")) current.parent("ul").parent("li").addClass("highlighted");
	
	//Hide all nested list items if they are not part of the highlighted main section
	$("ul#nav > li").each(function(el) {
		if(!$(this).hasClass("highlighted")) $(this).children("ul").css("display", "none");
    });
	
	//If no sub navs are on, change height of container
	if( $("ul#nav li ul:visible").length == 0) $("ul#nav").css("height", "auto");
	
});

























