//  binnen gehele document verwijderen voor online omgeving...

jQuery.preloadImages = function() {
	for(var i = 0; i<arguments.length; i++) {
		jQuery("<img>").attr("src", arguments[i]);
	}
}
$.preloadImages("/images/bg_nav_button.png",
				"/images/bg_nav_button_o.png");

$(document).ready(function(){

	$(".navButton").hover(
		function(){$(this).css("background-image", "url('/images/bg_nav_button_o.png')").css("cursor", "pointer");return false;},
		function(){$(this).css("background-image", "url('/images/bg_nav_button.png')").css("cursor", "default");return false;}
	).click(
		function(){window.location.href = $(this).find("a").attr("href");}
	);

	$(".objectMainBox").hover(
		function(){$(this).css("background-color", "#E2E2E2").css("cursor", "pointer");return false;},
		function(){$(this).css("background-color", "white").css("cursor", "default");return false;}
	).click(
		function(){
			if ($(this).parent().children(".objectSubBox").is(":hidden")) {
				$(this).parent().children(".objectSubBox").slideDown("slow");
			} else {
				$(this).parent().children(".objectSubBox").slideUp("slow");
			}
		}
	);

	$("#linkHideDetails").click(
		function(){
			$("#FMDetailsOn").hide();
			$("#FMDetailsOff").show();
		}
	);
	$("#linkShowDetails").click(
		function(){
			$("#FMDetailsOn").show();
			$("#FMDetailsOff").hide();
		}
	);

});

function WaardeVan_Change(Van, Tot)
{
	SelectVan = document.getElementById(Van)
	SelectTot = document.getElementById(Tot)
	n = (SelectTot.options[0].value == '' ? 1 : 0)
	if (SelectTot.selectedIndex <= SelectVan.selectedIndex && (SelectTot.selectedIndex != 0 || n == 0))
	if (SelectVan.selectedIndex == SelectTot.options.length - n)
	{
		SelectTot.selectedIndex = 0
	}
	else
	{
		SelectTot.selectedIndex = SelectVan.selectedIndex + n
	}
	if (SelectVan.options[SelectVan.selectedIndex].value == SelectTot.options[SelectTot.selectedIndex].value)
	{
	    var n = SelectTot.selectedIndex + 1
	    if (n > SelectTot.length-1) n = SelectTot.length-1
	    SelectTot.selectedIndex = n
	}
}

function WaardeTot_Change(Van, Tot)
{
	SelectVan = document.getElementById(Van)
	SelectTot = document.getElementById(Tot)
	n = (SelectTot.options[0].value == '' ? 1 : 0)
	if (SelectVan.selectedIndex >= SelectTot.selectedIndex && (SelectTot.selectedIndex != 0 || n == 0))
	{
		SelectVan.selectedIndex = SelectTot.selectedIndex - n
	}
	if (SelectVan.options[SelectVan.selectedIndex].value == SelectTot.options[SelectTot.selectedIndex].value)
	{
	    var n = SelectVan.selectedIndex - 1
	    if (n < 0) n = 0
	    SelectVan.selectedIndex = n
	}
}
