//<![CDATA[
	$(document).ready(function() {
		resize();
		/* UL op home page gelijk krijgen in hoogte  */
		$maxHoogteLI = 0;
		$('ul.detail-materialen-home').each(function(index) {
			$('li .title', this).each(function(index) {
				if ($(this).height() > $maxHoogteLI)
				{
					$maxHoogteLI = $(this).height();
				
				}
			});
			$('li .title', this).css('height', $maxHoogteLI);
			/* Hoogte clearen voor andere UL's */
			$maxHoogteLI = 0;
		});
		/* */
		
		if ($('.medewerkers '))
		{
		/* UL op home page gelijk krijgen in hoogte  */
		$maxHoogteMedewerker = 0;
		$('.medewerkers ').each(function(index) {
			$('.medewerker', this).each(function(index) {
				if ($(this).height() > $maxHoogteMedewerker)
				{
					$maxHoogteMedewerker = $(this).height();
				
				}
			});
			$('.medewerker', this).css('height', $maxHoogteMedewerker);
			/* Hoogte clearen voor andere UL's */
			$maxHoogteMedewerker = 0;
		});
		/* */
		}
		
		/* links naar uitschrijven en privacy policy verplaatsen*/
		if ($(".nieuwsbrief .policy").length > 0)
		{
			$(".nieuwsbrief .policy").appendTo($(".nieuwsbrief"));
		}
		

		/* Ref foto's */
		if ($(".ref-fotos").length > 0)
		{
			if ($(".ref-fotos .ref-andere .ref-foto").size() <= 1)
			{
				$(".ref-fotos .ref-andere .ref-foto").addClass("selected");
			}
			
		}
		
		if ($("a.linkedImage").length > 0)
		{
			$("a.linkedImage").fancybox({
				'titleShow'     : true,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'hideOnContentClick' : true
			});
		}
		
		$(".ref-fotos .ref-andere .ref-foto").click(function() {
			var panel = $(this).parent().parent().parent();
			$(panel).find(".ref-foto").removeClass("selected");	
		  	$(panel).find(".ref-grotefoto img").attr("src", $("a", this).attr("name"));
		  	$(this).addClass("selected");
			return false;
		});
		
		/* home page slider */
		
		if ($("#slider li").size() > 1)
		{
			$("#slider").easySlider({
				auto: true, 
				continuous: true,
				numeric: true,
				pause: 3000
			});
		}
		/* Searchmodule doorlinken naar results */
		$("div.search input[type=image]").click(function() {
			var txt = $("div.search input[type=text]").val();
			if(txt != "")
			{
				var currentHref = String(document.location);
				if (currentHref.indexOf("/EN/") > -1)
					window.location = "/";
				else if (currentHref.indexOf("/FR/") > -1)
					window.location = "/";
				else
					window.location = "/NL/Zoeken/Resultaten.aspx?search=" + txt;
			}
			return false;
		});
		
		/* Gelijk zetten van content (witte) pane en menu */
		if ($(".middle-center-zone .type-02").length > 0)
		{
			$menu = $("ul#side-nav");
			$content = $(".middle-center-zone");
			
			if ($menu.height() > $content.height())
			{
				$(".middle-center-zone").css('height', $("ul#side-nav").height());
	
			}
			else
			{
				$("ul#side-nav").css('height', $(".middle-center-zone").height());	
			}
		}
		
		/* Homebutton */
		var language = String(document.location);
		var reg = new RegExp("/[A-Z]{2}/");
		var zoekcaption;
		switch (String(reg.exec(language))) {
			case "/FR/" :
				$("#logo a").attr("href","/FR.aspx");
				zoekcaption = "Recherche";
			break;
			case "/EN/" :
				$("#logo a").attr("href","/EN.aspx");
				zoekcaption = "Search";
			break;
			default :
				$("#logo a").attr("href","/");
				zoekcaption = "Zoektermen";
			}
		if ($(".search").length > 0)
		{
			$(".search #field1").Watermark(zoekcaption);
		}
	});
	
	resize();
/* Default button (downloads) */
function DefaultButtonKeyPress(evt, thisElementName) {
	if(evt.which || evt.keyCode)
	{
		if ((evt.which == 13) || (evt.keyCode == 13))
		{
			__doPostBack(thisElementName,'');
			return false;
		}
	}
	else
	{
		return true;
	}
}

function resize()
{ 
		var left = $("#left-zone .left").height();
		var center = $("#left-zone .center").height();
		
		/*alert("left " + $("#left-zone .left").height());
		alert(" ,center "  + $("#left-zone .center").height());
		*/
		
		if (left < center) { left = center; }
		
		$("#left-zone .left").height(left);
}

$.fx.prototype.cur = function(){ // we are overwriting this function to remove limiting of the size of the

    if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      return this.elem[ this.prop ];
    }

    var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    return typeof r == 'undefined' ? 0 : r;
    
}
