
function confirmDelete( id, s, t, i )
{
	var parentPosition = Position.cumulativeOffset( $('sub-'+ id) );
	confirmAction(
		'editor-submissions',
		parentPosition['top'],
		650,
		'Are you sure you want to delete this submission?  If you only wish to decline the submission, click its title and set its status to "Declined".',
		'/delete/' + id + '?s=' + s + '&t=' + t + '&i=' + i
	);
}
function helpPopUp( id, message )
{
	var parentPosition = Position.cumulativeOffset( $(id) );
	confirmAction(
		'wrapper',
		parentPosition['top'],
		420,
		message,
		''
	);
}

// global confirmation pop-up box
var CONFIRM_CLASS		= 'confirmation-box';
var _confirmationBox	= null;
function confirmAction( containerId, top, left, message, url )
{
	if ( _confirmationBox != null )
		cancelConfrmation();

	var html =	'<p>' + message + '</p>';
	if ( url != '' )
	{
		html +=	'<input type="button" class="button confirm" value="Confirm" onclick="document.location.href=\'' + url + '\';"/>' +
				'<input type="button" class="button cancel" value="Cancel" onclick="cancelConfrmation()"/>';
	} else {
		html +=	'<input type="button" class="button cancel" value="OK" onclick="cancelConfrmation()"/>';
	}

	_confirmationBox = new Element( 'div', {
		'className':	CONFIRM_CLASS
	});
	_confirmationBox.style.top	= '' + top + 'px';
	_confirmationBox.style.left	= '' + left + 'px';
	_confirmationBox.innerHTML	= html;

	$(containerId).appendChild( _confirmationBox );
}
function cancelConfrmation()
{
	Element.remove( _confirmationBox );
	_confirmationBox = null;
}

function filterByStatus( start, issue )
{
	document.location.href = '/editor?s=' + start + '&i=' + issue + '&t=' + $F( 'statusfilter' );
}
function filterByIssue( start, status )
{
	document.location.href = '/editor?s=' + start + '&t=' + status + '&i=' + $F( 'issuefilter' );
}
