$(document).ready(function(){	
	$.easy.navigation();
	$.easy.tooltip();
	$.easy.popup();
	$.easy.external();
	$.easy.rotate();
	$.easy.forms();
	$.easy.showhide();
	$.easy.jump();
	
	var h = $(".content").height()
//	$(".links").height(h)
//	$(".rechts").height(h)

	$('.fadein').shuffle();
	$('.rotate').shuffle();

//	$('.resultaten:odd').css("background-color","#F3F3F3");

	$('.fadein img:gt(0)').hide();
	setInterval(function(){$('.fadein :first-child').fadeOut("slow").next('img').fadeIn("slow").end().appendTo('.fadein');}, 3000);
	
	if($("#original").length !== 0) {		
		$("#original").html($("#logoetc").html());
	}
	
	if($("h1[class!='titel']").length == 0) {
		$("h1[class='titel']").show();
	}
	
	var faqID = 0;

	$(".faq").click(function(){
		var id = $(this).attr("rel");
		$("p.antw[rel!='" + id + "']").slideUp(500,function(){
			if(Number(faqID) !== Number(id)) {
				$("p.antw[rel='" + id + "']").slideDown();														   
			}
			faqID = id
		});
	});
	
	$(".waterontharders").click(function(){
		document.location.href = 'waterbehandeling.asp'
	});	

	$(".waterkoelers").click(function(){
		document.location.href = 'drinkwatersystemen.asp'
	});	

	$("#homeslider").easySlider({
		auto: true,
		pause: 5000,
		continuous: true,
		numeric: true
	});

	$("#realisatieslider").easySlider({
		auto: false,
		continuous: true,
		numeric: false,
		prevText: "Vorige",
		nextText: "Volgende"
	});

	checkTeksten("0");
	
	var het = $("ul[rel='" + $("a[href='" + pg + "'][rel!='']").attr("rel") + "']");
	var tussen = het.prev("h3").children("a").html();
	if(tussen !== undefined && tussen !== null) {
		$("#breadd").html("&nbsp;>&nbsp;" + tussen + "&nbsp;");
	}

	function checkTeksten(id) {
		var h3 = $("#slider .slidertekst h3")
		var p = $("#slider .slidertekst p")
		var a = $("#slider .slidertekst a")
		
		$("#slider #actie").hide();
		$("#slider #promo").hide();
		$("#slider #indekijker").hide();

		var actie = $("#slider span[rel='sl_titel_" + id + "']").attr("actie");
		if(actie == "Actie") {
			$("#slider #actie").show();
		}

		if(actie == "Promo") {
			$("#slider #promo").show();
		}

		if(actie == "In de kijker") {
			$("#slider #indekijker").show();
		}
		
		h3.text($("#slider span[rel='sl_titel_" + id + "']").html());
		p.text($("#slider span[rel='sl_tekst_" + id + "']").html());
		a.attr("href","nieuwsitem.asp?id=" + $("span[rel='sl_link_" + id + "']").html());
	}
	
	var strH1 = $(".h3titel").html();
	if(strH1 + "" !== "null" && strH1 + "" !== "") {
		$("h1").html($(".h3titel").html());
	}
	
	$(".sliderfoto").css("display","block");

	aantalQuotes = $('.quotes').children("p").size();
	var numRand = Math.floor(Math.random()*aantalQuotes)	
	$("#quote_" + numRand).css("display","block");
});
