(function($){
	$(document).ready(function(){
		
		if ( $('.thank-you').length != 0 ) {
			$('.thank-you').css('opacity', 0);
			$('.thank-you').slideDown(500).animate({
				opacity: 1
			}, 1000);
		};
		
		$('a.print').click(function(){
			window.print();
			return false;
		})
		
		$('.colorbox').colorbox();
		
		$('#navigation > ul > li:last').addClass('last');
		
		$('.credits ul.menu > li:last span').remove();
		
		// Blinking Fields
		$('.blink').
		    focus(function() {
		        if(this.title==this.value) {
		            this.value = '';
		        }
		    }).
		    blur(function(){
		        if(this.value=='') {
		            this.value = this.title;
		        }
		    });
		// Navigation Dropdown
		$('#navigation > ul > li').hover(function(){
			$('#navigation > ul .sub-menu').hide();
			$(this).children('ul').stop(true,true).fadeToggle();
		}, function(){
			$('#navigation > ul .sub-menu').hide();
		});
		
		// Hero Fader
		var fader;
		$('#hero .item').simpleFade({
			speed    : 2000,
			duration : 4000,
			effect   : 'puff',
			init : function () {
				fader = this;
			},
			onFade : function (index) {
				$('#hero .nav a').removeClass('active').eq(index).addClass('active');
				$('#hero .text p').hide();
				$('#hero .text p').eq(index).fadeIn();
			}
		});
		
		$('#hero .nav a').click(function () {
			fader.fadeTo($('#hero .nav a').index(this));
			return false;
		});
		if ($('#featured-image img').length <= 1) {
			$('#featured-image').css('border', 0);	
		}
	});
	
	$(window).load(function(){
		if ($('.widecolumn').outerHeight(true) > $('.sidebar').outerHeight(true)) $('.sidebar').css('height', $('.widecolumn').outerHeight(true));
	});
})(jQuery)
