// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){







// this is instructions for the main scrolling.... ie. scrolling from homepage to sports page etc......................


	$('#outer-wrapper').serialScroll({
		target:'#slide-wrapper1',
		items:'li.scroll', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		//prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		//next:'img.next',// Selector to the 'next' button (absolute too)
		axis:'xy',// The default is 'y' scroll on both ways
		//navigation:'#ballmap li a',
		duration:400,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		
		
		onBefore:function( e, elem, $pane, $items, pos ){
			/**
			 * 'this' is the triggered element 
			 * e is the event object
			 * elem is the element we'll be scrolling to
			 * $pane is the element being scrolled
			 * $items is the items collection at this moment
			 * pos is the position of elem in the collection
			 * if it returns false, the event will be ignored
			 */
			 //those arguments with a $ are jqueryfied, elem isn't.
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
		
		
	});
	
	
	
	
	
	
			$('#logo').click(function(){
			$('#slide-wrapper1').trigger('goto', [0]);
			return false;
			});
				
			$('.homelink').click(function(){
			$('#slide-wrapper1').trigger('goto', [0]);
			return false;
			});
			
			$('.featureslink').click(function(){
			$('#slide-wrapper1').trigger('goto', [1]);
			return false;
			});		
			

	
			$('.sportslink').click(function(){
			$('#slide-wrapper1').trigger('goto', [2]);
			return false;
			});
	
	
	
	
	
	
	
	
	
	//these are subpages within the sportslink page.............................................
	
	
			$('.football-link').click(function(){
			$('#slide-wrapper1').trigger('goto', [3]);
			
			return false;
			});
			
			$('.netball-link').click(function(){
			$('#slide-wrapper1').trigger('goto', [4]);
			
			return false;
			});
	
			$('.cricket-link').click(function(){
			$('#slide-wrapper1').trigger('goto', [5]);
			
			return false;
			});
			
			$('.table-tennis-link').click(function(){
			$('#slide-wrapper1').trigger('goto', [6]);
			return false;
			});
	
	
	
	
	
	
	
	
	
//................................................................................

	
	
			$('.contactuslink').click(function(){
			$('#slide-wrapper1').trigger('goto', [7]);
			return false;
			});	

	

//Marcus, if you want to add more pages, you will need to slot them in as an <LI> after the contact us section. you will then need to copy and paste the code above, and change the number from 7 to 8 (consecutive if you add even more additional pages). you will also need to change the class (create a new class called ".mynewpage" or something), and assign that class to any links that should lead to the new page 












	
	
	
// these are instructions to scroll the embedded homepage features-overview information........................................

	$('#features').serialScroll({
		target:'#features-info',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		axis:'xy',// The default is 'y' scroll on both ways
		navigation:'#features-list li',
		duration:200,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		start:9,
		
		

		
		onBefore:function( e, elem, $pane, $items, pos ){
			/**
			 * 'this' is the triggered element 
			 * e is the event object
			 * elem is the element we'll be scrolling to
			 * $pane is the element being scrolled
			 * $items is the items collection at this moment
			 * pos is the position of elem in the collection
			 * if it returns false, the event will be ignored
			 */
			 //those arguments with a $ are jqueryfied, elem isn't.
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
		
		


});









// these are instructions to scroll the embedded "detailed features" section........................................


	$('#full-features').serialScroll({
		target:'#detailed-info-list',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		axis:'xy',// The default is 'y' scroll on both ways
		navigation:'#full-features-menu li',
		duration:200,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		
		
		

		
		onBefore:function( e, elem, $pane, $items, pos ){
			/**
			 * 'this' is the triggered element 
			 * e is the event object
			 * elem is the element we'll be scrolling to
			 * $pane is the element being scrolled
			 * $items is the items collection at this moment
			 * pos is the position of elem in the collection
			 * if it returns false, the event will be ignored
			 */
			 //those arguments with a $ are jqueryfied, elem isn't.
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
		
		


});


		
		



	
	
	
	
	




		
		
		

	

	
	
	
	
	
	
	
	
	
	
	
	
	
});
