/*
 * Based on jQuery JavaScript Library v1.3.2
 *
 * Custom
 * Copyright (c) 2009 aXcessTen Ltd
 *
*/

/*
 * Products - Tab switcher
 */
$(document).ready(function () {
	jQuery(function( $ ){
		$.localScroll.defaults.axis = 'x';
	
		// Scroll initially if there's a hash (#something) in the url 
		$.localScroll.hash({
			target: '#scroll-content', // Could be a selector or a jQuery object too.
			queue:true,
			duration:1500
		});
		$.localScroll({
			target: '#scroll-content', // could be a selector or a jQuery object too.
			queue:true,
			duration:1000,
			hash:true,
			onBefore:function( e, anchor, $target ){
				// The 'this' is the settings object, can be modified
			},
			onAfter:function( anchor, settings ){
				// The 'this' contains the scrolled element (#content)
			}
		});
	});
});


/*
 * Products - show hide more text for each product in range
 */
// Latest version @ http://andylangton.co.uk/jquery-show-hide

// this tells jquery to run the function below once the DOM is read
$(document).ready(function() {

	// choose text for the show/hide link
	var showText="show";
	var hideText="hide";
	
	// append show/hide links to the element directly preceding the element with a class of "toggle"
	$(".toggle").prev().append(' [<a href="#" class="toggleLink">'+showText+'</a>]');
	
	// hide all of the elements with a class of 'toggle'
	$('.toggle').hide();
	
	// capture clicks on the toggle links
	$('a.toggleLink').click(function() {
	
		// change the link depending on whether the element is shown or hidden
		if ($(this).html()==showText) {
			$(this).html(hideText);
			$(this).parent().next('.toggle').slideDown('slow');
		}
		else {
			$(this).html(showText);
			$(this).parent().next('.toggle').slideUp('slow');
		}
	
	
	// return false so any link destination is not followed
	return false;
	
	});
});


/*
 * Products - Lightbox Gallery Images
 */
    $(document).ready(function() {
        $('#gallery-images a').lightBox();
    });
	
