jQuery(document).ready(function(){
		
	/** ----- Slides ----- **/
	function slides() {
		jQuery('#feature_carousel').jcarousel({
			scroll: 1,
			auto: 10,
			wrap: 'both',
			animation: 1000,
			initCallback: feature_carousel_initCallback,
			buttonNextHTML: null,
			buttonPrevHTML: null,
			easing: 'easeInOutExpo'
		});
	}
	slides();

});



/** ----- Functions ----- **/

	jQuery(function(){ //smoothscroll
						 
		jQuery('.smooth_scroll a').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
				&& location.hostname == this.hostname) {
					var $target = $(this.hash);
					$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					$('html,body').animate({scrollTop: targetOffset}, 1000);
					return false;
				}
			}
		});
		
	});


	function feature_carousel_initCallback($carousel) {
		
		jQuery('.jcarousel-control a').bind('click', function() {
			$carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('rel')));
			$carousel.startAuto(0);
			return false;
		});
		
		jQuery('#scroll-right a, #feature_desc_wrapper a.carousel_desc_next').bind('click', function() {
			$carousel.next();
			$carousel.startAuto(0);
			return false;
		});
		
		jQuery('#scroll-left a, #feature_desc_wrapper a.carousel_desc_prev').bind('click', function() {
			$carousel.prev();
			$carousel.startAuto(0);
			return false;
		});

	};
