$(function(){
	// Initialize menus
	$('ul#primaryNav').superfish({ 
		//animation:   {opacity:'show',height:'show'},  
		speed:       0,
		autoArrows:  false,
		dropShadows: false
	});
	//Open external links in a new window
	$("a[href^=http]").click(function(){
		if(!$(this).hasClass("sameWindow"))
		{
		window.open(this.href);
		return false;
		}
	});
	//Open PDFs in a new window
	$("a[href*='.pdf']").click(function(){
		window.open(this.href);
		return false;
	});
	//Open Commonspot uploaded documents in a new window
	$("a[href*='security/getfile']").click(function(){
		window.open(this.href);
		return false;
	});
	//Fix for CommonSpot nested lists
	//$("li ul").parent().css("background-image", "none");
	// Set up navigation highlighting
	var path = location.pathname, lastChar;
	lastChar = path.charAt(path.length - 1);
	if (lastChar === "/")
	{
		path = path + "index.cfm";
	}
	// Highlight primary nav items
	if (path.indexOf("/about-us/") != -1)
	{
		$("a#aboutUs").addClass("highlight");
	}
	else if (path.indexOf("/initiatives/") != -1)
	{
		$("a#initiatives").addClass("highlight");
	}
	else if (path.indexOf("/issues/") != -1)
	{
		$("a#issues").addClass("highlight");
	}
	else if (path.indexOf("/progress/") != -1)
	{
		$("a#progress").addClass("highlight");
	}
	else if (path.indexOf("/careers/") != -1)
	{
		$("a#careers").addClass("highlight");
	}
});


