$(document).ready(function(){
	$('.external').click(function() {
	window.open($(this).attr("href"),null);
	return false;
	})

	$("a[href^='mailto:']").click(
	function(){
	   theLink = $(this).attr('href').replace('mailto:','')
	   pageTracker._trackPageview("/emails/"+theLink);
	})
	
	$("a[href^='http:']:not([href*='" + window.location.host + "'])").not("[href*='software.webpac.com']").click(
function(){
  
   theLink = $(this).attr('href').replace('http://','')
   pageTracker._trackPageview("/external-links/"+theLink);
   /* new window open thing here */  
  });

  $("div#relatedCategories a.closeButton").live("click",function(){
    $(this).parentsUntil("div#relatedCategories").parent().find("ul").slideUp(function(){$(this).parent().find(".topBlock").addClass("closed");});
    $(this).text("OPEN").addClass("open");
    
    return false;
  });

  $("div#relatedCategories a.closeButton.open").live("click",function(){
   $(this).parentsUntil("div#relatedCategories").parent().find("ul").slideDown();
    $(this).text("CLOSE").removeClass("open");
    $(this).parent().removeClass("closed");
    return false;
  });

  $("li.Print a").click(function(){
     window.print();
     return false;
  });

});
