
// om de hoeveel milliseconden wisselen?
ms = 4000;

function RotateImages(n)
{
	if (n > 7) { n = 1; }
	$("#slider a").attr("href", "diensten.html#"+n);
	$("#slider a").click(function(){
		$(".service").removeClass("open");
		$(".service p").hide();
		$("#service"+n).addClass("open");
		$("#service"+n+" p").show();
	});
	$("#slider img").attr("src", "images/slider-"+n+".jpg");
	window.setTimeout("RotateImages("+(n+1)+")", ms);
}


$(document).ready(function(){


	RotateImages(1);
	$("#slider a").click(function(){
		n = $(this).attr("href").substr("1");
		$(".service").removeClass("open");
		$(".service p").hide();
		$("#service"+n).addClass("open");
		$("#service"+n+" p").show();
	});


	$(".service h2 a").click(function(){

		n = $(this).attr("href").substr("1");
		b = $("#service"+n).hasClass("open");

		$(".service").removeClass("open");
		$(".service p").hide();

		if (b==false)
		{
			$("#service"+n).addClass("open");
			$("#service"+n+" p").show();
		}
	});


	if (document.location.hash && document.location.hash.substr("1").length == 1);
	{
		n = document.location.hash.substr("1");
		$("#service"+n).addClass("open");
		$("#service"+n+" p").show();
	}


	// apply png fix if browser is ie6
	if (!window.XMLHttpRequest) {
		$("#right .icon img").each(function(){
			val = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + $(this).attr("src") + "');";
			$(this).attr("style", val).attr("src", "images/blank.gif");
		});
	}


});





