$(function(){


	// Cufon font replacement
	Cufon.replace('#header h1 .line1', { fontFamily: 'Myriad Pro', textShadow: 'rgba(0, 0, 0, 0.12) 1px 2px' });
	Cufon.replace('#header h1 .line2', { fontFamily: 'Bradley Hand ITC', textShadow: 'rgba(0, 0, 0, 0.12) 1px 2px' });
	Cufon.replace('#right h2, #right h3, #right h5', { fontFamily: 'Myriad Pro' });



	// Header image rotator
	$('#header .rotator').innerfade({
		animationtype: 'fade', // fade or slide
		speed: 500, // animation speed in milliseconds
		timeout: 5000, // time between animations in milliseconds
		type: 'sequence', // sequence, random, or random_start
		containerheight: '161px' // height of the containing element
	}); 


	// Navigation submenu
	$('#left > .nav > ul > li').hover(
		function(){
			$(this).addClass('hover');
		},
		function(){
			$(this).removeClass('hover');
		}
	);
	$('#left > .nav > ul > li:has(ul)').click(function(e){
		if(!$(this).hasClass('active')) {
			$(this).parent().children('li.active').removeClass('active').children('ul').slideUp(200);
			$(this).addClass('active').children('ul').slideDown(200);
			e.preventDefault();
		}
	});
	
		// Middle column list
	$('#right .list h4 a').click(function(){
		$(this).parent().parent().children('p').slideToggle(200);
		return false;
	});

	// Open external links in a new window
	$('a[rel=external]').click(function(e){
		open(this.href);
		e.preventDefault();
	});



});
