function update_tags()
{
	document.getElementById('picture_div').style.visibility = zoomed ? 'hidden' : 'visible';
	document.getElementById('picture_zoom_div').style.visibility = zoomed ? 'visible' : 'hidden';

	document.getElementById('picture').src = 'dbpicture.php?size=medium&id=' + pictures[current_picture];
	document.getElementById('picture_nav_left').style.visibility = !zoomed && current_picture > 0 ? "visible" : "hidden";
	document.getElementById('picture_nav_right').style.visibility = !zoomed && current_picture < pictures.length-1 ? "visible" : "hidden";

	document.getElementById('zoom_picture').src = 'dbpicture.php?size=large&id=' + pictures[current_picture];
	document.getElementById('zoom_nav_left').style.visibility = zoomed && current_picture > 0 ? "visible" : "hidden";
	document.getElementById('zoom_nav_right').style.visibility = zoomed && current_picture < pictures.length-1 ? "visible" : "hidden";
}

function prev_picture()
{
	if (current_picture > 0)
	{
		current_picture--;
		update_tags();
	}
}

function next_picture()
{
	if (current_picture < pictures.length-1)
	{
		current_picture++;
		update_tags();
	}
}

function show_picture_zoom()
{
	zoomed = true;
	update_tags();
}

function hide_picture_zoom()
{
	zoomed = false;
	update_tags();
}

function print_article()
{
	//window.location.href = 'print.php?id=' + article_id + "&picture=" + current_picture;
	window.open('print.php?id=' + article_id + "&picture=" + current_picture, '_blank');
}

