/* APP.js */

$(document).ready(function() {
	
	$('#hero_slides ul').carouFredSel({
		auto: true,
		circular: true,
		items: {
			visible: 1,
			width: 736,
			height: 414
		},
		scroll : {
			items: 1,
			duration: 900,							
			pauseOnHover: "resume",
			fx: 'directscroll',
			easing: 'quadratic',
			onBefore	: function(oldItems, newItems) {

				newItems.each(function() {

					var position = $(this).attr('data-position');

					if (position == 0 || position == ''){
						$('#hero_nav span.indicator').animate({left:'80px'}, 250);
					} 
					else if (position == 1){
						$('#hero_nav span.indicator').animate({left:'266px'}, 250);
					}
					else if (position == 2){
						$('#hero_nav span.indicator').animate({left:'450px'}, 250);
					}
					else if (position == 3){
						$('#hero_nav span.indicator').animate({left:'634px'}, 250);
					}

				});

			}
		},
		pagination	: {
				container		: "#hnav",
				anchorBuilder	: false
		}
});
	
});

