jQuery(function( $ ){
	/**
	 * THIS BLOCK IS SPECIFICALLY FOR THE DEMO
	 * Binding of the section links, to load other sections inside the content div
	 */
	var $sections = $('#navi a'),// Links on the left
		last = null;// Last section
	
	$sections.click(function(){
		if( last != this ){ // let's avoid needless requests
			var url = 'html/' + this.hash.slice(1) + '.html';
			$('#content').html( '<p class="loading">Loading...</p>' ).load( url, function(){
				this.scrollLeft = 0;//scroll back to the left
			});
		}
		last = this;
		this.blur(); // Remove the awful outline
		return false;
	});
	
	$sections.eq(0).click(); // Load the first section
	
	/**
	 * Actual call to jQuery.localScroll.
	 * Most jQuery.LocalScroll's defaults, belong to jQuery.ScrollTo, check it's demo for an example of each option.
	 * @see http://flesler.demos.com/jquery/scrollTo/
	 */
	
$.localScroll({
		target: '#slides', //could be a selector or a jQuery object too.
	axis:'yx', //the default is 'y'
		hash:false,
		duration:1800,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:false, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		constant:true, // constant speed
		
		queue:true,// We scroll on both axes, scroll both at the same time.
		event:'click',// On which event to react (click is the default, you probably won't need to specify it)
		stop:true,// Each click will stop any previous animations of the target. (false by default)
		lock:false, // Ignore events if already animating (true by default)		
		//start: 0, // On which element (index) to begin ( 0 is the default, redundant in this case )		
		cycle:true,// Cycle endlessly ( constant velocity, true is the default )
		//step:1, // How many items to scroll each time ( 1 is the default, no need to specify )
		//jump:false, // If true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
		//lazy:false,// (default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
		//interval:1000, // It's the number of milliseconds to automatically go to the next

		onBefore:function( e, subsec, $cont ){//'this' is the clicked link
			if( this.blur )
				this.blur(); // Remove the awful outline
		}
	});

	$(document).ready(function()
	{

	$("#FrontMenu .navi a").addClass("sel");
		
		$("#FrontMenu .navi a").click(function()
		{
			$("#FrontMenu .navi .sel").removeClass("sel");
			$(this).parent().addClass("sel");
			return false;
		});
		





	$('a[@rel*=lightbox]').lightBox();


});




});



