	function openup(element)
	{
		$('.add').hide();
		$('.active').removeClass();
		$(element).parent().addClass('active');
		$(element).next('.add').show();
	}
	
	$(document).ready(function() {
		
		jQuery("#navigation ul li").hover(function () {
			//$(this).addClass('active');
			jQuery(this).children('#navigation ul li ul').fadeIn('fast');
		}, function () {
			//$(this).addRemove('active');
			jQuery(this).children('#navigation ul li ul').hide();
		});
		
		jQuery(".secNav").ready(function() {
			jQuery(".sub2").hide(); // hide the sub menus
			jQuery(".sub3").hide();
			jQuery(".sub4").hide();
			jQuery(".active .sub2").show(); //show the sub menu in the active LI
			jQuery(".current .sub2").show(); //show the sub menu in the active LI
			jQuery(".current .sub2 .active .sub3").show(); //show the sub menu in the active LI
			jQuery(".current .sub2 .current .sub3").show(); //show the sub menu in the active LI
			jQuery(".current .sub2 .current .sub3 .active .sub4").show(); //show the sub menu in the active LI
			jQuery(".current .sub2 .current .sub3 .current .sub4").show(); //show the sub menu in the active LI
		});
		
		jQuery('#news').click(function(){
			jQuery(this).next().removeClass('active');
			jQuery(this).addClass('active');
			jQuery('#latest-news-home').hide();
			jQuery('#latest-news-main').fadeIn('slow');
		});
		
		jQuery('#news-podcast').click(function(){
			jQuery(this).prev().removeClass('active');
			jQuery(this).addClass('active');
			jQuery('#latest-news-main').hide();
			jQuery('#latest-news-home').fadeIn(
				'slow'
				, 
				function() //callback function
				{
					if($("#controls2").length==0)
					jQuery("#latest-news-podcast").easySlider({
						controlsBefore:	'<p id="controls2">',
						controlsAfter:	'</p>',
						prevId: 'prevBtn2',
						nextId: 'nextBtn2'
					});
				}
			);
		});
		
		//preload images
		/*var hp1BackgroundImage = $('.hp1')[0].style.backgroundImage;
		    hp1BackgroundImage = hp1BackgroundImage.substring(4, hp1BackgroundImage.length-1);
			//alert('Loading ' + hp1BackgroundImage);
			jQuery("<img>").attr("src", hp1BackgroundImage);
			
		var hp2BackgroundImage = $('.hp2')[0].style.backgroundImage;
		    hp2BackgroundImage = hp2BackgroundImage.substring(4, hp2BackgroundImage.length-1);
			//alert('Loading ' + hp2BackgroundImage);
			jQuery("<img>").attr("src", hp2BackgroundImage);
			
		var hp3BackgroundImage = $('.hp3')[0].style.backgroundImage;
		    hp3BackgroundImage = hp3BackgroundImage.substring(4, hp3BackgroundImage.length-1);
			//alert('Loading ' + hp3BackgroundImage);
			jQuery("<img>").attr("src", hp3BackgroundImage);*/
			
		
		jQuery('#homefeatures-nav ul li.hpli0').click(function(){
			jQuery('#homefeatures-nav ul li').removeClass('active');
			jQuery(this).addClass('active');
			jQuery('.hp0').fadeIn('slow');
			jQuery('.hp1').hide();
			jQuery('.hp2').hide();
			jQuery('.hp3').hide();
		});
		
		jQuery('#homefeatures-nav ul li.hpli1').click(function(){
			jQuery('#homefeatures-nav ul li').removeClass('active');
			jQuery$(this).addClass('active');
			jQuery('.hp1').fadeIn('slow');
			jQuery('.hp0').hide();
			jQuery('.hp2').hide();
			jQuery('.hp3').hide();
		});
		
		jQuery('#homefeatures-nav ul li.hpli2').click(function(){
			jQuery('#homefeatures-nav ul li').removeClass('active');
			jQuery(this).addClass('active');
			jQuery('.hp2').fadeIn('slow');
			jQuery('.hp0').hide();
			jQuery('.hp1').hide();
			jQuery('.hp3').hide();
		});
		
		jQuery('#homefeatures-nav ul li.hpli3').click(function(){
			jQuery('#homefeatures-nav ul li').removeClass('active');
			jQuery(this).addClass('active');
			jQuery('.hp3').fadeIn('slow');
			jQuery('.hp0').hide();
			jQuery('.hp1').hide();
			jQuery('.hp2').hide();
		});
		
		jQuery('#productslist ul li').hover(function () {
			$(this).find('.productDecs').fadeIn('fast');
		}, function () {
			$(this).find('.productDecs').hide();
		});
		
		jQuery('.ridersleft .rideRead a.rideMore').click(function(){
			jQuery('.full-story').hide();
			jQuery('.rideClose').hide();
			jQuery('.rideMore').show();
			jQuery(this).parent().prev('.full-story').fadeIn();
			jQuery(this).hide();
			jQuery(this).next('.rideClose').fadeIn();
		});
		
		jQuery('.ridersleft .rideRead a.rideClose').click(function(){
			jQuery('.full-story').hide();
			jQuery('.rideClose').hide();
			jQuery('.rideMore').show();
		});
		
		jQuery('.stockLocleft ul li a').click(function(){
			//$('.add').hide();
			//$('.active').removeClass();
			//$(this).parent().addClass('active');
			//$(this).next('.add').show();
            openup(this);
		});
		
	});
