 /*
 * jQuery Active Session 1.1
 * For use with BigCommerce hosted sites ONLY
 * Author: Ian Hallworth
 * http://www.hallworthdesign.co.uk
 * Date: 26 Oct 2010
 * Depends on: jQuery core - http://docs.jquery.com/Downloading_jQuery
 * Depends on jquery.ba-nth-last-child.min.js - http://benalman.com/projects/jquery-misc-plugins/
 */
 $(document).ready(function(){ 
	// get the url
	var $path = location.pathname; 
	// initialise variables 
	var $currentPage, $WhichList; 
	// Get the text of the last item in the first breadcrumb list
	var $breadcrumbLast = $('.Breadcrumb ul:first-child').children().eq(1).text();
	// Get the text of the penultimate item in the first breadcrumb list
	var $breadcrumbPenultimate = $('.Breadcrumb ul:first-child li:nth-last-child(2)').text();
	
	if ($path.length > 1) {
		$currentPage = $breadcrumbLast;
		$WhichList = '#SideCategoryList';
	}
	
	// go through every item in the chosen list
	$($WhichList+' ul li').each(function() {
		// get the text for the list item 
		text = $(this).text();
		if (text.match($currentPage)) {
			// Add a class to the list item if you find a text match and return
			return $(this).addClass('ActiveSection');
		}
	})	
});

        
jQuery(document).ready(function($) {
	$('.SideCategoryListClassic ul li a').not('.SideCategoryListClassic ul li ul li a').not(':last').click(function(e) {
		e.preventDefault();
		$(this).parent().parent().siblings().children().children('a').not(this).siblings().hide();
		$(this).siblings().toggle();
	});

	/*$('.HasSubMenu').click(function(e) {
		e.preventDefault();
		$('.HasSubMenu ul').toggle();
	});*/

  	$('.ProductList :nth-child(4n)').addClass('right');

  	$('#newsletterOpen').click(function() {
  		$('#SignUp').toggle();
	});
	
});	

