$(document).ready(function () {
	// 1. Create scroll effect
	// 2. handle the selection of the navigation
	
	var horizontal = true;
	var $panels = $('#slider .panel');
	var $container = $('#slider .scrollContainer');
	var $scroll = $('#slider .scroll').css('overflow', 'hidden');
	
	$scroll
		.before('<img src="img/scroll_left.png" class="scrollButtons left" />')
		.after('<img src="img/scroll_right.png" class="scrollButtons right" />');
		
	if (horizontal) {
		$panels.css({
			'float' : 'left',
			'position' : 'relative'
		});
		
		$container.css('width', $panels[0].offsetWidth * $panels.length);
	}	
	
	var scrollOptions = {
		target: $scroll,
		items: $panels,
		prev: 'img.left',
		next: 'img.right',
		axis: 'xy',
		duration: 500,
		easing: 'swing'
	};
	
	$('#slider').serialScroll(scrollOptions);
	
});
