$(document).ready(function() {
	$('.image_container img').hide().filter(':first-child').show();

	$('.product_category_list ul li a').hover(
        function() {
		var allElems = $(this).closest('.product_category_item').find('.image_container img').hide();
		var selElem = allElems.filter($(this).attr("rel")).show();
		if ( selElem.length == 0) allElems.filter(':first').show();
        },
        function() {
		$(this).closest('.product_category_item').find('.image_container img').show();
        }
	 );


	$(".roll").hover(
		function() {
			curr = $(this).attr("src");
            overlen = curr.length;
			over = curr.substr(0, overlen-4);
			over = over+'_h.gif';
            $(this).attr({ src: over});
   		},
		function() {
			$(this).attr({ src: curr});
		}
	)
	
	$(".rollover").css("opacity", 0.5);
	$(".rollover").hover(
		// hover state
		function() {
			jQuery(this).css("opacity", 1.0);
		},
		// back to off
		function() {
			jQuery(this).css("opacity", 0.5);
		});
	
	 $('#timeline_content div').hide(); // Hide all divs
	 $('#timeline_content div:first').show(); // Show the first div
	 $('#timeline li a:first').addClass('active');
	 $('#timeline li a').click(function(){ // When link is clicked
		 $('#timeline li a').removeClass('active'); // Remove active class from links
		 $(this).addClass('active'); //Set parent of clicked link class to active
		 var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
		 $('#timeline_content div').hide(); // Hide all divs
		 $(currentTab).fadeIn("slow"); // Show div with id equal to variable currentTab
		 return false;
	 });
	   
	 $("input[type=radio]").css({"border":"none", "width":"auto", "padding":"0"});

});

