$(document).ready(function() {
	$(".menuItem").mouseover(function(){
		$('body').css('cursor', 'pointer');
		$(this).css('background','url(img/menu_bg_act.gif)');
	});
	$(".menuItem").mouseout(function(){
		$('body').css('cursor', 'default'); 
		$(this).css('background','url(img/menu_bg.gif)');
	});
	
	$(".boektr").mouseover(function(){
		$('body').css('cursor', 'pointer');
		//$(this).css('background','#EFEFEF');
	});
	$(".boektr").mouseout(function(){
		$('body').css('cursor', 'default'); 
		//$(this).css('background','#E8DCC0');
	});
	
	$(".backbutton").mouseover(function(){
		$('body').css('cursor', 'pointer');
		$(this).css('background','url(img/back_act.gif)');
	});
	$(".backbutton").mouseout(function(){
		$('body').css('cursor', 'default'); 
		$(this).css('background','url(img/back.gif)');
	});
	
	
	//header icon mouseover
	$(".headerIcon").mouseover(function(){
		var cur = $(this).attr('src');
		var hoelang = cur.length;
		if(cur.substr(4,3) != "ro_") {
			$(this).attr('src','img/ro_'+cur.substr(4,hoelang));
		}
	});
	$(".headerIcon").mouseout(function(){
		var cur = $(this).attr('src');
		var hoelang = cur.length;
		if(cur.substr(4,3) == "ro_") {
			var newsrc = 'img/'+cur.substr(7,hoelang);
			$(this).attr('src', newsrc);
		}
	});
	
	
	
	reactieani = false;
	$("#reactie").click(function(){
		if(reactieani == false) {
			reactieani = true;
			var reactieState = $('#reactieform').css("height");
			if(reactieState == "0px") {
				$('#reactieform').animate({height:'285px'},500,"linear",function(){reactieani=false;});
			} else {
				$('#reactieform').animate({height:'0px'},500,"linear",function(){reactieani=false;});
				$('.message').css("display","none");
			}
		}	
	});	
});

function minheader() {
	switch($("#header").css("height")) {
		case "163px":
		$("#header").animate({
			height: "32px"
		}, 800, "linear");
		
		setTimeout('$("#hideshowheader").attr("src", "img/show_icon.png")', 800);
		
		break;
		case "32px":
		$(".top").css("background", "transparent")
		setTimeout('$("#hideshowheader").attr("src", "img/hide_icon.png")', 800);
		$("#header").animate({
			height: "163px"
		}, 800, "linear");
		break;
	}
}
function fullscreen() {
	window.open(window.location, "fullscreen", "fullscreen, scrollbars");
}

function gastenboek(reactieArr, nummer) {
	var aantal = reactieArr.length;

	if(nummer == aantal) {
		nummer = 0;
	}
	$(".gastenboekContainer").animate({ opacity: 0 }, 500 );
	setTimeout(function() {
		$('.gastenboekContainer').text(reactieArr[nummer]);
		$(".gastenboekContainer").animate({ opacity: 1 }, 500 );
		nummer++;
		setTimeout("gastenboek(reacties, "+nummer+")", 4000);
	}, 500);
}