$( function() {
	
	jQuery.fn.toggleDefault = function(text) {
		$(this).focus( function() {
			if ( $(this).val() == text ) {
				$(this).val("");
			}
		});
		$(this).blur( function() {
			if ( $(this).val() == "" ) {
				$(this).val(text);
			}
		});
	};
	
	$("form .submit").click( function() {
		$(this).parents("form").submit();
	});
	
	$("ul#menu_rechtsgebieden li").not(".selected").hover(function() {
		$(this).animate({ width:"260px" }, 300);
	}, function() {
		$(this).animate({ width:"244px" }, 300);
	});
	
	$("ul#menu_rechtsgebieden li").not(".selected").click(function() {
		document.location.href = $("a", this).attr("href");
	});
	
	$("form[name=search_global] input:text").toggleDefault("zoek op trefwoord...");
	
	$("img[rel=toggleImg]").hover(function() {
		$(this).attr("src", $(this).attr("src").replace("_off", "_on"));
	}, function() {
		$(this).attr("src", $(this).attr("src").replace("_on", "_off"));
	});
	
});