/*

	This was taken from the HTML5 Boiler Plate
	
	http://html5boilerplate.com/
	https://github.com/paulirish/html5-boilerplate
	
	Remap jQuery to $

*/

(function($){

	/*
	
		Slider unce unce
	
	*/
	
    $('#slider').nivoSlider({
        effect:'fold',
        slices: 1,
        animSpeed: 500,
        directionNav: false,
        controlNav: false
    });

	/*
	
		Zebra some tables
	
	*/
	
	if($('table tr').length){

		$('table tr').each(function(i, el){
		
			var new_class = i % 2 ? 'even' : 'odd';
			
			$(el).addClass(new_class);
		
		});
	
	}

	/*
	
		Popups for the photo gallery
	
	*/
	
	$("a[rel=fancybox-1]").fancybox({
		titleShow: false
	});
	
	/*
	
		Guestbook
	
	*/

	if($('#coda-slider-1').length){
	
		$('#coda-slider-1').codaSlider({
			autoSlide: false,
			dynamicTabs: false
		});
	
	}
	
	/*
	
		Add some nicer content to the mailto link
	
	*/
	
	$('a.sm_email_now').click(function(e){
	
		e.preventDefault();
		
		NAME = NAME.replace('&#8211;','-');
				
		var new_href = $(this).attr('href') + '?subject=You need to visit ' + NAME + '&body=You should visit ' + NAME + ' (' + HOME + ')';
				
		window.location = new_href;
			
	});

})(this.jQuery);
