/* Author: shawn@tinyearth.net */
$(document).ready(function() {

	// Form Validation
	if ($('.validate').length > 0) {
		$('.validate').validate();
	}

	// Site Navigation Hover Fade Effects
	$('nav.site li')
        .removeClass('highlight')	
    	.find('a')
		.append('<span class="hover" />').each(function () {
			$($(this).find("span")[0]).addClass("remove")
			var $span = $('> span.hover', this).css('opacity', 0);
			$(this).hover(function () {
				// on hover
				$span.stop().fadeTo(350, 1);
			}, function () {
				// off hover
				$span.stop().fadeTo(350, 0);
			});
		});

	// Initialize Shadowbox
    var sb_options = {
		animSequence:		'sync',
		counterType:		'skip',
		continuous:			true
    };
	Shadowbox.init(sb_options);
	// Add Shadowbox listeners
	if ($('.sb-imgs').length > 0) {
		Shadowbox.setup($('.sb-imgs'), {
			gallery:	'Gallery'
		});
	}
		
});
