function onPage(page)
{
	document.location.href=g_phpFilename + "?category=" + g_category + "&page=" + page;
	return false;
}

function photoPopup(src, width, height)
{
	var screenWidth = window.screen.width;
	var screenHeight = window.screen.height - 100;
	var ratio = width / height;
	
	if (width > screenWidth && width > height)
	{
		width = screenWidth;
		height = width / ratio;
	}
	
	if (height > screenHeight && height > width)
	{
		height = screenHeight;
		width = height * ratio;	
	}
	
	var left = (screenWidth - width)/2;
	var top = (screenHeight - height)/2;
	if (left < 0)
		left = 0;
	if (top < 0)
		top = 0;
		
	var w = window.open('about:blank', 'photo', 'left=' + left + ', top=' + top + ', width=' + width + ',height=' + height);
	
	w.document.write("<a href='javascript:window.close();' title='Klik om te sluiten'><img border='0' width='" + width + "' height='" + height + "' src='" + src + "'></a>");

	list = w.document.getElementsByTagName('body');
	var body = list.length > 0 ? list[0] : null;
	
	if (body)
	{
		body.style.marginTop="0px";
		body.style.marginLeft="0px";
	}
}