jQuery(document).ready(function(){
    
    // display value in search field
    jQuery('input.searchInput, input.emptyonclick').emptyonclick();


    // dropdown menu
    $("#menu ul ul").css({display: "none"}); // Opera Fix
    $("#menu ul li").hover(function(){
		    jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(120);
		    },function(){
		    jQuery(this).find('ul:first').css({visibility: "hidden"});
		    });


    // scrollbar roles
    $('#paneRole').jScrollPane({scrollbarWidth:3, scrollbarMargin:8});


    // Animate navigation in #primary sidebar

    
	    // hide navigation by default
	    $(".sidebar div.toggle ul").hide();
	    $(".sidebar div.toggle ul.actief").show();
	    $(".sidebar div.ms-WPBody div.toggleRole div.panewrap").hide();
	    $(".sidebar div.ms-WPBody div.toggleRole div.panewrap-actief").show();
	
	    // disabling link to allow dropdown     
	    $('.sidebar div.toggle h4 a, .sidebar div.toggleRole h4 a').click(function(e) {e.preventDefault();  });
	
	    // SlideToggle on click    	
	    $(".sidebar div.toggle h4").click(function () {
		$(this).next().slideToggle("slow");
	    });

	    $(".sidebar div.toggleRole h4").click(function () {
		$(this).next("div.panewrap").slideToggle("slow");
	    });

   // disabling link to allow dropdown     
    $('#menu li a.nolink').click(function(e) {e.preventDefault();  });



    // Greyscale hover
	$("ul.greyhover li").hover(function() { //On hover...

		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('fast', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('slow', 1).show();
	});




});
