// This function will enable or disable a control and change the background colour
// controlID:	control's client ID
// enabled:		true to enable, false to disable
function EnableControl(controlID, enabled)
{
	var ctl = document.getElementById(controlID);
	
	// Get the object and set wheter it is enabled or disabled
	ctl.disabled = !enabled;
	if(enabled)
	{	// If enebaled then apply a white backgroud
		ctl.style.backgroundColor = 'white';
	}
	else
	{	// If enebaled then apply a grey background and clear the text
		ctl.style.backgroundColor = '#F5F5F5';
		ctl.innerText = "";
	}
}

function EnableListControl(controlID, enabled)
{
	var ctl = document.getElementById(controlID);
	
	// Get the object and set wheter it is enabled or disabled
	ctl.disabled = !enabled;
	if(enabled)
	{	// If enebaled then apply a white backgroud
		ctl.style.backgroundColor = 'white';
	}
	else
	{	// If enebaled then apply a grey background and clear the text
		ctl.style.backgroundColor = '#F5F5F5';
	}
}

function EnableControlByObject(controlObject, enabled)
{
	// Get the object and set wheter it is enabled or disabled
	controlObject.disabled = !enabled;
	
	// Set styles accordingly
	if(enabled)
	{	// If enebaled then apply a white backgroud
		controlObject.style.backgroundColor = 'white';
	}
	else
	{	// If enebaled then apply a grey background and clear the text
		controlObject.style.backgroundColor = '#F5F5F5';
		controlObject.innerText = "";
	}
}