/**
 *	Set the enable/diable status of a checkbox
 *
 *	object: object to be operated on, can be a checkbox or not
 *	args[0]: in case the object is a check box, indicates the desired status
 *
 */
function setCheckBoxEnabledStatusA(object, args)
{
	setCheckBoxEnabledStatus(object, args[0])
}

/**
 *	Set the enable/diable status of a checkbox
 *
 *	object: object to be operated on, can be a checkbox or not
 *	status: in case the object is a check box, indicates the desired status
 *
 */
function setCheckBoxEnabledStatus(object, status)
{
	if(isCheckbox(object)) object.disabled = !status
}

/** 
 *	Set checkbox to be checked (true) or unchecked (false). 
 *	
 *	object: object to be operated on, can be a checkbox or not
 *	args[0]: in case the object is a check box, indicates the desired status
 *
 */
function setCheckBoxCheckStatusA(object, args)
{
	setCheckBoxCheckStatus(object, args[0])
}

/**
 *	Unchecks a check box
 *	
 *	object: object to be operated on, can be a checkbox or not
 *	status: in case the object is a check box, indicates the desired status
 *	
 */
function setCheckBoxCheckStatus(object, status)
{
	if(isCheckbox(object)) object.checked = status
}

/**
 *	Toggle a checkbox's check status
 *	
 *	object: object to be operated on, can be a checkbox or not
 *	
 */
function reverseCheckBoxCheckStatus(object)
{
	if(isCheckbox(object)) object.checked = !object.checked 
}

/**
 *	Check whether an ojbect is a checkbox
 *	
 *	object: object to be operated on, can be a checkbox or not
 *	
 */
function isCheckbox(object)
{
	return object.type == "checkbox"
}

