function deleteNews(newsitem)
{
	var answer=confirm("Are you sure you would like to delete this news item?");
	if(answer)
	{
		window.location='../main/page.php?page_id=2&deletenews=yes&deleteid='+newsitem;
	}
}
function deleteGal(galleryid,categoryid)
{
	var answer=confirm("Are you sure you would like to delete this gallery item?");
	if(answer)
	{
		window.location='../main/page.php?showgallery=yes&deletegal=yes&deleteid='+galleryid+'&category_id='+categoryid;
	}
}
function deleteCat(categoryid)
{
	var answer=confirm("Are you sure you would like to delete this empty category?");
	if(answer)
	{
		window.location='../main/page.php?showgallery=yes&deletecat=yes&deleteid='+categoryid;
	}
}

function showNext()
{
	var currentitem=parseInt(document.getElementById('currSelection').value);
	var highestitem=parseInt(document.getElementById('highestphoto').value);

	if (currentitem==highestitem)
		nextitem=1;
	else
		nextitem=currentitem+1;

	galleryid=document.getElementById('photo'+nextitem).value;
	closephoto=document.getElementById('photo'+currentitem).value;

	maxclose(closephoto);
	maxgrow(galleryid,0);
}
function showPrev()
{
	var currentitem=parseInt(document.getElementById('currSelection').value);
	var highestitem=parseInt(document.getElementById('highestphoto').value);

	if (currentitem==1)
		nextitem=highestitem;
	else
		nextitem=currentitem-1;

	galleryid=document.getElementById('photo'+nextitem).value;
	closephoto=document.getElementById('photo'+currentitem).value;

	maxclose(closephoto);
	maxgrow(galleryid,0);
}
