// jQuery functions to be executed over the whole website

	$(document).ready(function(){
		// NAVIGATION START
		$("#nav li ul").addClass("jqhide");
		   $("#nav li").hover(
			function(){
			  $(this).children("ul").show();
			},function(){
			  $(this).children("ul").hide();
			});
		// END

		// TABLEROW START
		$(function(){
		   $("#sub table tr:even").addClass("even");
		   $("#sub table tr:odd").addClass("odd");
		});
		// END

		// IMG SELECTOR START
		$("#loopSlider div.container a").hover(function(){
			var largePath = $(this).attr("href");
			var largeAlt = $(this).attr("title");
			$("#sub #textProd #largeImg").attr({ src: largePath, alt: largeAlt });  
			return false;
		});
		// Make sure dat een click nergens meer heen gaat!
		$("#loopSlider div.container a").click(function(){
			return false;
		});
		// END
		
		// DETAILS START
		$("#detail div.det_left a").hover(function(){
			var largePath = $(this).attr("href");
			var largeAlt = $(this).attr("title");
			$("#detail div.det_right #largeImg").attr({ src: largePath, alt: largeAlt });  
			return false;
		});
		// Make sure dat een click nergens meer heen gaat!
		$("#detail div.det_left a").click(function(){
			return false;
		});
		// END
		
		// FADER START
		$(".det_left img").fadeTo("fast", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads

		$(".det_left img").hover(function(){
			$(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
		},function(){
			$(this).fadeTo("fast", 0.6); // This should set the opacity back to 60% on mouseout
		});

	});

	

	// SLIDESHOW FP START

		function slideSwitch() {
			var $active = $('#fpText #textImg IMG.active');
			if ( $active.length == 0 ) $active = $('#fpText #textImg IMG:last');
			// use this to pull the images in the order they appear in the markup
			var $next =  $active.next().length ? $active.next()
				: $('#fpText #textImg IMG:first');
			// uncomment the 3 lines below to pull the images in random order
			// var $sibs  = $active.siblings();
			// var rndNum = Math.floor(Math.random() * $sibs.length );
			// var $next  = $( $sibs[ rndNum ] );

			$active.addClass('last-active');
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
				});
		}

		$(function() {
			setInterval( "slideSwitch()", 3000 );
		});
		// END



