$(document).ready(function() {
  
   
    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    }); 


  
  // Cufon
  Cufon.replace('#content h1, body.home #content h2');
  
  // Open PDFs & external links in new window
  $("a[href*=.pdf]").click(function(){
		window.open(this.href);
		return false;
	});
	
	// DD_belatedPNG fix for IE6
	if (typeof DD_belatedPNG != "undefined" ) {
		DD_belatedPNG.fix('#sidebar li span, .page-content img, #content .gallery-top li a, .buttons img, .testimonial span.top, .quote, .tabs li a');
	}
	
	$("#nav li").hover(
		function(){ $("ul", this).fadeIn("fast"); }, 
		function() { $("ul", this).fadeOut("fast"); } 
	);
	if (document.all) {
		$("#nav li").hoverClass ("sfHover");
	}



});


$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};
