function report(id)
{
	if (confirm('Remember that no images won\'t be removed just because they\'re immoral.\nImages will only be remove if they violate Swedish laws or due to technical reasons.\n\nReport image?'))
	{
		new Ajax.Request('/ajax_report.php', {method: 'post', parameters: 'id=' + id});

		/* some eyecandy */
		Effect.Fade('reportlink', { duration: 0.6 } );
		span = document.getElementById('report');
		a    = document.getElementById('reportlink');

		span2 = document.createElement('span');
		span2.id = "reportlink";
		setTimeout("span.removeChild(a); span.appendChild(document.createTextNode('Report Image'))", 600);
	}
}

function resize(which, Width, Height)
{
	var elem = document.getElementById(which);
	if (elem == undefined || elem == null) return false;

	/* fixed once and for all */
	if (Width > 715)
	{
		elem.style.height = 'auto';
		elem.style.width = '715px';
	}
	else
	{
		elem.style.height = 'auto';
		elem.style.width = 'auto';
	}
}

function resizeTo(which, width, height)
{
	var elem = document.getElementById(which);
	if (elem == undefined || elem == null) return false;
	elem.style.height = 'auto';
	elem.style.width = width + 'px';
}

/* ugly hack to toggle image size */
if (typeof(big) == 'undefined')	var big = 0;
function toggleResize(which, width, height)
{
	if (big == 0)
	{
		resizeTo(which, width, height);
		big = 1;
	}
	else
	{
		resize(which, width, height);
		big = 0;
	}
}
