$(function(){
	// Initialize menus
	$('ul#primaryNav').superfish({ 
		animation:   {opacity:'show',height:'show'},
		autoArrows:  false,
		dropShadows: false
	});
	// Set up navigation highlighting
	var path = location.pathname;
	
	// Highlight primary nav items
	if (path.indexOf("/solutions/") != -1)
	{
		$("a#solutions").addClass("highlight");
	}
	else if (path.indexOf("/products/") != -1)
	{
		$("a#products").addClass("highlight");
	}
	else if (path.indexOf("/services/") != -1)
	{
		$("a#services").addClass("highlight");
	}
	else if (path.indexOf("/knowledge-center/") != -1)
	{
		$("a#knowledgeCenter").addClass("highlight");
	}
	else if (path.indexOf("/news-events/") != -1)
	{
		$("a#newsEvents").addClass("highlight");
	}
	else if (path.indexOf("/about-us/") != -1)
	{
		$("a#aboutUs").addClass("highlight");
	}
	// Highlight current page
	$("#secondaryNav li a[href='" + path + "']").addClass("highlight");
	// Highlight special cases
	if (path.indexOf("/news-events/press-releases/") != -1)
	{
		$("#secondaryNav li a[href='/news-events/']").addClass("highlight");
	}
	if (path.indexOf("/about-us/careers/") != -1)
	{
		$("#secondaryNav li a[href='/about-us/careers/']").addClass("highlight");
	}
	if (path.indexOf("/about-us/contact-us") != -1)
	{
		$("#secondaryNav li a[href='/about-us/contact-us/']").addClass("highlight");
	}
	if (path.indexOf("/about-us/request-a-demo") != -1)
	{
		$("#secondaryNav li a[href='/about-us/request-a-demo/']").addClass("highlight");
	}
	//Open external links in a new window
	$("a[href^=http]").click(function(){
		window.open(this.href);
		return false;
	});
	$("a[href*='/linkservid/']").click(function(){
		window.open(this.href);
		return false;
	});
	//Open PDFs in a new window
	$("a[href*='.pdf']").click(function(){
		window.open(this.href);
		return false;
	});
	//Open new window by class
	$(".newWindow").click(function(){
		window.open(this.href);
		return false;
	});
});


