jQuery(document).ready(function() {

	// Toggle subnavs on click.
	jQuery('ul#nav>li>ul').parent().find('a:first').click(function() {
		jQuery('ul#nav>li>ul').slideUp('normal');
		jQuery(this).next().slideToggle('normal');
		return false;
	});


	// Close all on load.
	jQuery('ul#nav>li>ul').hide();

	// Attach Cycle animation.
	jQuery('.image_reel').cycle({
		fx: 'fade'
	});

	// Attach Fancybox.
	jQuery('#portfolio-images a').fancybox({
		'titleShow'  : true,
		'titlePosition'  : 'over'
	});
		// And open the first gallery slide on click of a panel image.
	jQuery('#portfolio-images img').hover(
		function() {
			jQuery(this).css('cursor', 'pointer').fadeTo(1, .9)
		}, function() {
			jQuery(this).css('cursor', 'default').fadeTo(1, 1)
		}
	).click(function() {
		jQuery(this).next('a').click();
	});



	// Reveal contact info on click.
	jQuery('a.show-email').click(function(e) {
		e.preventDefault();
		jQuery(this).parent().next('.contact-emails').slideToggle('fast');
	});

});





