Cufon.replace("h2,h3,.pullquote p,.pullquote blockquote,button.submit, .ctabox p");
Cufon.replace(".ctabox p a.action", {textShadow: "-1px -1px #69a215;"});
Cufon.replace("#nav > ul > li > a", {
		textShadow: "-1px -1px #014976",
		hover: {
			color: '#003866',
			textShadow: "1px 1px #94cbe7"
		}	
	});
		
$(document).ready(function() {
	// add disclosure icons to any top level nav items that have subnavs
	$("#nav > ul > li").has("ul").not(".current").children("a")
		.after('<a href="#" class="disclosure"></a>');

	// add the "current page" pointer in the right place
	$("#nav li.active > a").after('<div id="pointer"></div>');
	
	// when disclosure icon is clicked slide out the menu underneath
	$("a.disclosure").click(function(event) {
		$(this).parent().find("ul").slideToggle();
		return false;
	});
	
	// show the disclosure icon when the main a is hovered
	$("#nav > ul > li > a").hover(
		function() {
			$(this).parent().children("a").addClass("hover").filter("a.disclosure").show();
		},
		function() {
			$(this).parent().children("a").removeClass("hover").filter("a.disclosure").hide();
		}
	);
	
	$("#searchForm input.query").focus(function(){		
		$(this).val('')
	});
	
	// analytics tracking for downloads
	$("a").each(function() {
			try{
	                //protocol, host, hostname, port, pathname, search, hash
	                if (this.protocol == "mailto:") {
	                        $(this).click(trackMailto);
	                } else if (this.hostname == location.host) {
	                        var path = this.pathname + this.search;
							var isDoc = path.match(/\.(?:doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\&|\?)/);
	                        if (isDoc) {
								$(this).click(trackExternalLinks);
	                        }
	                } else {
	                        $(this).click(trackExternalLinks);
	                }
			}
			catch(e){}	
        });
});

function trackMailto () {
        var href = this.href;
        var mailto = "/mailto/" + href.substring(7);
        if (typeof(pageTracker) == "object") pageTracker._trackPageview(mailto);
}

function trackExternalLinks () {		
		var e = this;
        var lnk = (e.pathname.charAt(0) == "/") ? e.pathname : "/" + e.pathname;
        if (e.search && e.pathname.indexOf(e.search) == -1) lnk += e.search;
        if (e.hostname != location.host) lnk = "/external/" + e.hostname + lnk;
		
        if (typeof(pageTracker) == "object") {
			pageTracker._trackPageview(lnk);
		} 
}




