	$(document).ready(function() {
		// hide normal featured list, show js enabled list
		$('#default-list').html( '' );
		$('#js-list').css( 'display', 'block' );
		 
		var $panels = $('#slider .scrollContainer > li');
		var $container = $('#slider .scrollContainer');
		
		// pagination values
		var $page = $('#page');
		var $pages = $('#pages');
	
		// calculate a new width for the container (so it holds all panels)
		$container.css('width', $panels[0].offsetWidth * $panels.length);
	
		// collect the scroll object, at the same time apply the hidden overflow
		// to remove the default scrollbars that will appear
		var $scroll = $('#slider .scroll').css('overflow', 'hidden');
	
	
		// use ID's to track current page
		$($panels).each( function(i) {
			$(this).attr('id', (i + 1)); // add ID (starting with 1) to all LI's
		});
	
	
		// set initial pagination 
		$pages.text($panels.length);
		
	
		// if only 1 property disable next nav link
		if ($pages.text() == '1') {
			$('#next').find('a').removeClass('active-link').removeAttr('href');
		}
	
	
		// update pagination info on click
		function pagination(data) {
			$page.text(data.id);
			if ($page.text() == $pages.text()) {
				// remove styling and null link
				$('#next').find('a').removeClass('active-link').removeAttr('href');
				// add styling and activate link
				$('#previous').find('a').addClass('active-link').attr('href', '#');
			}
			else if ($page.text() == '1') {
				// reverse if statement
				$('#previous').find('a').removeClass('active-link').removeAttr('href');
				$('#next').find('a').addClass('active-link').attr('href', '#');
			}
			else if ($page.text() > '1') {
				$('#previous').find('a').addClass('active-link').attr('href', '#');
				$('#next').find('a').addClass('active-link').attr('href', '#'); 
			}
		}
	
	
		var scrollOptions = {
			target: $scroll,
	
			items: $panels,
	
			prev: 'dd.back', 
			next: 'dd.next',
	
			axis: 'x',
	
			onAfter: pagination,
	
			constant: false,
			
			cycle: false,
	
			duration: 500,
			
			easing: 'swing'
		};
	
		$('#slider').serialScroll(scrollOptions);

	});
	
