// jQuery for use across the site.

$(document).ready( function() {
	function fixWrapper() {
		fullHeight = $(window).height();
		wrapper = $('div.wrapper');
		if( $('div.wrapper *').outerHeight() < fullHeight ) {
			wrapper.css('min-height', fullHeight);
		} 
	}
	
	fixWrapper();
	
	$(window).resize( function() {
		fixWrapper();
	});
	
	$('div.latest-products ul li:nth-child(4)').addClass('last');
	$('div.latest-products ul li:nth-child(8)').addClass('last');
	
	$('ul.nav').superfish({
		animation: {height: 'show'},
		speed: 'fast',
		autoArrows: false,
		dropShadows: false
	});
	
	$('div.carousel ul').jcarousel({
		scroll: 1,
		wrap: 'circular',
		auto: 5,
		visible: 1
	});
	
	$('div.main div.category ul li:odd').addClass('odd');
	
});
