$(function(){
	if($(".scrollable").length > 0) {
		mh = 0;
		$(".scrollable").find("div.panel").each(function() {
			h = $(this).outerHeight();
			mh = h > mh ? h : mh;
		});
		$(".scrollable").css("height", mh);
		$(".scrollable").css("min-height", mh);
		
		$(".scrollable").scrollable();
		var sapi = $(".scrollable").data("scrollable");
		var speed = 0;
		$("ul.navigation a").click(function() {
			$("ul.navigation li").removeClass("active");
			$(this).parent("li").addClass("active");
			
			ind = $(this).parent("li").index();
			sapi.seekTo(ind, speed);
			speed = 500;
		});
		
		if($("ul.navigation li.active").length > 0) {
			$("ul.navigation li.active a").click();
		} else {
			$("ul.navigation li a").eq(0).click();
		}
		
		// direct springen naar een index indien er een hash is
		var anchor = window.location.hash.replace("#", "");
		if (anchor != '') {
			var speed = 0;
			$("li[rel^='"+anchor+"']").find("a").click();
		}
	}
	
	$("#map area").hover(function () {
		showMap(this);
	}, function () {
		hideMap(this);
	});
	
	$(".cr").corner();
	
	$(".cr-top").corner("top");
	
	$('#banners').innerfade({
		  speed: 1000
		, timeout: 4000
		, sequence: 'random' 
	});
});
function showMap(who) {
	m = $(who).attr("rel");
	$("#c" + m).show();
	//$("#pop" + m).show();
}
function hideMap(who) {
	m = $(who).attr("rel");
	$("#c" + m).hide();
}
