	
$(document).ready(function() { 
		
				
	// ---- Main Menu ----------------------------------------------------------------------------------------------------------
		
	$('#range li:nth-child(5n)').addClass('no-margin');
		

	
	// ---- Slider  ----------------------------------------------------------------------------------------------------------
		

		var currentID = $('#slideshow div.active').attr('id');
		$('#slideshow-nav a[href$='+currentID+']').addClass('active');
		slideSwitch = function () {
			var $active = $('#slideshow div.active');
			if ( $active.length == 0 ) $active = $('#slideshow div:last');
			var $next =  $active.next().length ? $active.next() : $('#slideshow div:first');
			$active.addClass('last-active');
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
				});
			$('#slideshow-nav a').removeClass('active');
			var currentID = $next.attr('id');
			$('#slideshow-nav a[href$='+currentID+']').addClass('active');
		}
		
		$('#slideshow-nav a').click(function(){
			clearInterval(sliderIntervalID);
			$('#slideshow-nav a').removeClass('active');		
			$(this).addClass('active');			
			var clickedSlide = $(this).attr('href').replace("#","");
			var $active = $('#slideshow div.active');
			$('#slideshow div.active').removeClass('active').addClass('last-active');
			$('#slideshow div').each(function(){
				if($(this).attr('id') == clickedSlide){
					$(this).css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
				});
				}
			});

			return false;
		});
	
		var sliderIntervalID = setInterval("slideSwitch()",6000); 


});
