function naarTop() {
	$('html').scrollTop(0); 
}
function printView()
{
	printUrl	= document.location + '?view=print';
	
	window.open(printUrl);
}

makeSideButtonsClickable = function() {
	$("#side ul li").hover(function() {
		$(this).addClass("side_hover");
	}, function() {
		$(this).removeClass("side_hover");
	});
	$("#side ul li").click(function() {
		if ($(this).attr("target") == "_blank") {
			window.open($(this).attr("rel"));
		} else {
			document.location=$(this).attr("rel");
		}
	});
}

// enforce min-height page content -->>
//
initPageHeight = function()
{
	if ($("#page").height() < $("#side").height() && $("#side").height() > 320) {
		$("#page").height($("#side").height() + 20);
	}
	else if ($("#page").height() < $("#side_homepage").height() && $("#side_homepage").height() > 320) {
		$("#page").height($("#side_homepage").height() + 20);
	}
	else if ($("#page").height() < $("#menu_page").height() && $("#menu_page").height() > 320) {
		$("#page").height($("#menu_page").height() + 20);
	}
	else if ($("#bekoform").attr("id") == "bekoform") {
		$("#page").height('auto');
	}
	else if ($("#page").height() < 320)	{
		$("#page").height(320);
	}
	
	$("#footer").show();
}
	

function convertDlLists(action)
{
	if (typeof action != 'undefined' && !action)
	{
		$("#page dt").unbind();
		$("#page dt").css("background-image", "url(/img/toggler_minus.gif)");
		$("#page dd").show();
	}
	else
	{
		$("#page dt").css("background-image", "url(/img/toggler_plus.gif)");
		$("#page dd").hide();
		
		$("#page dl").each(function()
		{
			$(this).children("dt").each(function()
			{
				$(this).click(function()
				{
					if ($(this).next().css("display") == "block")
					{
						$(this).next().hide();
						$(this).css("background-image", "url(/img/toggler_plus.gif)");
					}
					else
					{
						$(this).parent().children("dt").each(function()
						{
							$(this).css("background-image", "url(/img/toggler_plus.gif)");
						});
						
						$(this).parent().children("dd").each(function()
						{
							$(this).hide();
						});
						
						$(this).next().show();
						$(this).css("background-image", "url(/img/toggler_minus.gif)");
					}
					
					$("#page").height('auto');
					
					initPageHeight();
				});
			});
		});
	}
}
