﻿var bFading = false;

$(document).ready(function() {
	
	$(".picfader img:not(:first)").hide();

	$(".picfader").after("<div class=\"picfaderprikker\"></div>")

	$(".picfader img").each(function(i, val) {
		$(".picfaderprikker").append("<img src=\"/css/graphics/greydot.gif\">");
	});

	$(".picfaderprikker img:first").attr("src","/css/graphics/reddot.gif");
	
	$(".picfaderprikker img").mouseover(function() {
		if (!bFading) {
			bFading = true;
			var intThisprikindex = $(".picfaderprikker img").index(this);
			if ($(".picfader img:eq(" + intThisprikindex + ")").css("display") != 'block') {
				$(".picfaderprikker img").attr("src","/css/graphics/greydot.gif");
				$(this).attr("src","/css/graphics/reddot.gif");
				$(".picfader img:not(:hidden)").fadeOut(150);
				$(".picfader img:eq(" + intThisprikindex + ")").fadeIn(150);
			}
			bFading = false;
		}
	});
	
	if ($(".contentright .tabs").size() > 0) {

		var strHash = location.hash.replace("#","");

		if (strHash != '') {
			$("#tab" + strHash).show();
			
			if($(".contentright .tabs:visible").size() == 0) {
				$(".tabs:first").show();
			}
			
		} else {
			$(".tabs:first").show();
		}
		
		$(".header a").click(function() {
			var strSection = $(this).attr("href").replace("#","");
			
			$(".contentright .tabs").hide();
			$("#tab" + strSection).show();
			$(this).blur();
		});
		
	}

});
