<!--
/*
 *	$Id: common.js,v 1.1.1.1 2003/11/24 12:58:45 jgauld Exp $
 *	$Name:  $
 *
 *	Common Functions
 */

// Globals
var BLOCKING = false;

//-------------------------------
// loadObject()
// - Loads the specified module/action/id by redirecting the browser
//-------------------------------
function loadObject(mod, action, id) {

	// Blocking
	if(BLOCKING) return false;
	BLOCKING = true;

	// Vars
	BLOCKING = true;

	// Redirect browser
	self.location = EXNT_genHREF(mod, action, {id:id});
	
	// Return Value (required for onClick event in <a> tags)
	event.returnValue = false;
}

//-------------------------------
// saveObject()
// - Sets 'id' to the specified id, and submits the form
//-------------------------------
function saveObject(id, form) {

	// Blocking
	if(BLOCKING) return false;
	BLOCKING = true;

	// Set oid
	form['id'].value = id;

	// Submit form
	form.submit();
}

//-------------------------------
// deleteObject()
// - Sets the action to delete and submits the form
//-------------------------------
function deleteObject(id, form) {

	// Blocking
	if(BLOCKING) return false;
	BLOCKING = true;

	// Confirm
	if(!confirm('Are you sure you wish to delete this object?')) {
		BLOCKING = false;
		return false;
	}

	// Set action and id
	form['oper'].value = 'delete';
	form['id'].value = id;

	// Submit form
	form.submit();
}
//-->