/*
Description: Main - JavaScript for Mariposa
Author: Josh Gerdes
*/
$(document).ready(function() {

	// Add image swap effect
	$.swapImage('.swapImage');
	
	// Add background image resize
	$('#bgimage').bgimage(); 
	
	// Add accordian feature to content
	$('#accordion').accordion({
			autoHeight: false,
			navigation: true
		});
	
	// Add event handlers to resize the content div to eliminate height issues
	$(window).bind('load', setContentHeight);
	$(window).bind('resize', setContentHeight);

	function setContentHeight() {
		if ($('#content').length) {
			var newHeight = $(window).height() - $('#content').offset().top - $('#content').outerHeight() + $('#content').height();
			$('#content').css('min-height', newHeight );
		}
	}
});

