// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

$(document).ready(function(){
	
	// alert('jQuery is working!');

	// product zoom toggle
	$('div#product_boards').click(function(){
		$('div#product_boards').fadeOut("fast");
		$('div#product_boards_zoom').fadeIn("fast")
		$('div#product_boards_zoom_close').fadeIn("fast");
		return false;
	});
	$('div#product_boards_zoom_close').click(function(){
		$('div#product_boards_zoom').fadeOut("fast");
		$('div#product_boards_zoom_close').fadeOut("fast");
		$('div#product_boards').fadeIn("fast");
		return false;
	});
	
	// support answer toggle
	$(".question").click(function(){
		// jQuery(this).siblings(".answer").toggle();
		$(".answer").hide();
		$(this).siblings(".answer").show();
	});

	// helmet diy show/hide
	$('div#helmets_diy_small').click(function(){
		$('div#helmets_diy').fadeIn("slow");
		$('div#helmets_diy_small').hide();
	});
	
	$('div#helmets_diy').click(function(){
		$('div#helmets_diy_small').show();
		$('div#helmets_diy').fadeOut("slow");
	});

	// helmet details show/hide
	$('div#helmet_detail1_small').click(function(){
		$('div#helmet_detail1').fadeIn("slow");
		$('div#helmet_detail2').fadeOut("slow");
		$('div#helmet_detail3').fadeOut("slow");
		$('div#helmet_details_close').show();
		$('div#product_helmets').hide();
	});
	
	$('div#helmet_detail2_small').click(function(){
		$('div#helmet_detail2').fadeIn("slow");
		$('div#helmet_detail1').fadeOut("slow");
		$('div#helmet_detail3').fadeOut("slow");
		$('div#helmet_details_close').show();
		$('div#product_helmets').hide();
	});
	
	$('div#helmet_detail3_small').click(function(){
		$('div#helmet_detail3').fadeIn("slow");
		$('div#helmet_detail1').fadeOut("slow");
		$('div#helmet_detail2').fadeOut("slow");
		$('div#helmet_details_close').show();
		$('div#product_helmets').hide();
	});	
	
	$('div#helmet_details_close').click(function(){
		$('div#helmet_detail3').fadeOut("slow");
		$('div#helmet_detail1').fadeOut("slow");
		$('div#helmet_detail2').fadeOut("slow");
		$('div#helmet_details_close').hide();
		$('div#product_helmets').fadeIn("slow");
	});
		
	// boot swaps
	$('div#product_boots_swap1').click(function(){
		$('div#product_boots_swap2').fadeIn("slow");
		$('div#product_boots_swap1').hide();
	});
	
	$('div#product_boots_swap2').click(function(){
		$('div#product_boots_swap1').fadeIn("slow");
		$('div#product_boots_swap2').hide();
	});
	
	// binding swaps
	$('div#product_bindings_swap1').click(function(){
		$('div#product_bindings_swap2').fadeIn("slow");
		$('div#product_bindings_swap1').hide();
	});
	
	$('div#product_bindings_swap2').click(function(){
		$('div#product_bindings_swap1').fadeIn("slow");
		$('div#product_bindings_swap2').hide();
	});	
	
	// helmets swaps
	$('div#product_helmets_swap1').click(function(){
		$('div#product_helmets_swap2').fadeIn("slow");
		$('div#product_helmets_swap1').hide();
	});
	
	$('div#product_helmets_swap2').click(function(){
		$('div#product_helmets_swap1').fadeIn("slow");
		$('div#product_helmets_swap2').hide();
	});
	
	// shawn durst photo swaps 
	$('div#sd_thumb2').mouseover(function(){
		$('div#sd_photo2').show();
		$('div#sd_photo1').hide();
	});
	
	$('div#sd_thumb2').mouseout(function(){
		$('div#sd_photo1').show();
		$('div#sd_photo2').hide();
	});
	
	$('div#sd_thumb3').mouseover(function(){
		$('div#sd_photo3').show();
		$('div#sd_photo1').hide();
	});
	$('div#sd_thumb3').mouseout(function(){
		$('div#sd_photo1').show();
		$('div#sd_photo3').hide();
	});
	$('div#sd_thumb4').mouseover(function(){
		$('div#sd_photo4').show();
		$('div#sd_photo1').hide();
	});
	$('div#sd_thumb4').mouseout(function(){
		$('div#sd_photo1').show();
		$('div#sd_photo4').hide();
	});

	// layne knaack photo swaps 
	$('div#lk_thumb2').mouseover(function(){
		$('div#lk_photo2').show();
		$('div#lk_photo1').hide();
	});
	
	$('div#lk_thumb2').mouseout(function(){
		$('div#lk_photo1').show();
		$('div#lk_photo2').hide();
	});
	
	$('div#lk_thumb3').mouseover(function(){
		$('div#lk_photo3').show();
		$('div#lk_photo1').hide();
	});
	$('div#lk_thumb3').mouseout(function(){
		$('div#lk_photo1').show();
		$('div#lk_photo3').hide();
	});
	$('div#lk_thumb4').mouseover(function(){
		$('div#lk_photo4').show();
		$('div#lk_photo1').hide();
	});
	$('div#lk_thumb4').mouseout(function(){
		$('div#lk_photo1').show();
		$('div#lk_photo4').hide();
	});
	
	// jimi tomer photo swaps 
	$('div#jt_thumb2').mouseover(function(){
		$('div#jt_photo2').show();
		$('div#jt_photo1').hide();
	});
	
	$('div#jt_thumb2').mouseout(function(){
		$('div#jt_photo1').show();
		$('div#jt_photo2').hide();
	});
	
	$('div#jt_thumb3').mouseover(function(){
		$('div#jt_photo3').show();
		$('div#jt_photo1').hide();
	});
	$('div#jt_thumb3').mouseout(function(){
		$('div#jt_photo1').show();
		$('div#jt_photo3').hide();
	});
	$('div#jt_thumb4').mouseover(function(){
		$('div#jt_photo4').show();
		$('div#jt_photo1').hide();
	});
	$('div#jt_thumb4').mouseout(function(){
		$('div#jt_photo1').show();
		$('div#jt_photo4').hide();
	});
	
	
// athletes main swaps
	$('div#athletes').click(function(){
		$('div#athletes_riders').show();
		$('div#athletes_video').hide();
	});
	
	$('div#video').click(function(){
		$('div#athletes_video').show();
		$('div#athletes_riders').hide();
	});

});