var EffectSpeed = 200;
$(document).ready(function()
{
	$("a[href=#]").click(function()
	{
		return false;
	})

	$("a[rel=external]").click(function()
	{
		$(this).attr("target", "_blank");
	})

	$("a.wide").click(function()
	{
		if($("#cssWide").attr("disabled") == true)
		{
			$("#cssWide").attr("disabled", false);
			intValue = 1;
		}
		else
		{
			$("#cssWide").attr("disabled", true);
			intValue = 0;
		}

		$.post(strPath + "ajax_utilities.php", "type=wide-screen&value=" + intValue);
	});

	$("a.high-contrast").click(function()
	{
		if($("#cssHighContrast").attr("disabled") == true)
		{
			$("#cssHighContrast").attr("disabled", false);
			intValue = 1;
		}
		else
		{
			$("#cssHighContrast").attr("disabled", true);
			intValue = 0;
		}

		$.post(strPath + "ajax_utilities.php", "type=high-contrast&value=" + intValue);

	});

	$("a.font-size-small").click(function()
	{
		$("#body").css("fontSize","9px");
		$.post(strPath + "ajax_utilities.php", "type=font-size&value=1");
	});
	$("a.font-size-medium").click(function()
	{
		$("#body").css("fontSize","10px");
		$.post(strPath + "ajax_utilities.php", "type=font-size&value=2");
	});
	$("a.font-size-large").click(function()
	{
		$("#body").css("fontSize","11px");
		$.post(strPath + "ajax_utilities.php", "type=font-size&value=3");
	});

	$("#btn-comment").click(function(){
		CheckForm($(this));
	});


	//--Hover Submenu
	blnSubMenuHover = false;
	$("li[id^=hover]").hover(
	function()
	{
		blnSubMenuHover = true;

		var strId = $(this).attr("id");
		var arrId = strId.split("_");
		var intItemno = arrId[1];

		//--Laten verdwijnen van alle divs
		$("div[id^=submenu]").each(function()
		{
			$(this).hide();
		});

		//--Tonen van de geselecteerde div
		$("div[id^=submenu_" + intItemno + "]").show();

	}
	,function()
	{
		blnSubMenuHover = false;

		//--Functie oproepen na 200 miliseconden die de div doet verdwijnen als er niet op een submenu gestaan wordt.
		setTimeout("RemoveSubMenuHover()",100);
	});

	//--Div menus overlopen
	$("div[id^=submenu]").hover(
	function()
	{
		//--Als er op een div menu gestaan wordt, wordt een boolean op true gezet
		blnSubMenuHover = true;
	},
	function()
	{
		//--Als er van een div menu weggegaan wordt, dan verdwijnen de andere menus.
		blnSubMenuHover = false;
		setTimeout("RemoveSubMenuHover()",100);
	}
	)
});


function RemoveSubMenuHover()
{
	if(blnSubMenuHover == false)
	{
		$("div[id^=submenu]").each(function()
		{
			$(this).hide();
		});
	}
}

function GetItemsBlock(intItemno)
{
	$.post(strPath + "ajax_item_blocks.php", "itemno=" + intItemno, function(objData)
	{
		if(objData != "")
		{
			$("#linkeditems-block").html(objData);
		}
		else
		{
			$("#linkeditems-block").hide();
		}
	}, "html");
}
