$(function() {

	$("div.views a").hover(function() {
		$(this).addClass("highlight");
	}, function() {
		$(this).removeClass("highlight");
	});


	$("div.location-widget:not(.active)").hide().addClass("widget").append($("<button id='widget-closer' title='Snel zoeken sluiten'>sluiten</button>").click(function(e) {
		$("div.location-widget").slideUp("slow", function() {
			if (ie6) {
				$("div.resultcontainer select").css("visibility","visible");
			}
		});
		e.preventDefault();
	}));

	$.equalHeights($("#content").height() + $("#content").offset().top + 30);

	$("div.resultcontainer > p.link-to-widget > a").toggle(function(e) {
		if (ie6) {
			$("div.resultcontainer select").css("visibility","hidden");
		}
		var widget = $("div.location-widget");
		if (widget.filter(":visible").length == 0) {
			widget.css({
				left: (window.screen.width) / 4,
				top: "80px"
			});
			widget.slideDown("slow");
		} else {
			widget.slideUp("slow", function() {
				if (ie6) {
					$("div.resultcontainer select").css("visibility","visible");
				}
			});
		}
		e.preventDefault();
	}, function(e) {
		var widget = $("div.location-widget");
		if (widget.filter(":visible").length == 0) {
			if (ie6) {
				$("div.resultcontainer select").css("visibility","hidden");
			}
			widget.slideDown("slow");
		} else {
			widget.slideUp("slow", function() {
				if (ie6) {
					$("div.resultcontainer select").css("visibility","visible");
				}
			});
		}
		e.preventDefault();
	});

});