<!-- 
function SelectAllCheckboxes(masterCheckBox, containerID, checkBoxesID)
{
	// Get all inputs from page (change to only grid maybe?)
	var elements = document.getElementsByTagName("INPUT");
	
	// create regex pattern
	var pattern = '(' + containerID + ')(\\w)*(' + checkBoxesID + ')';
	var regularExpression = new RegExp(pattern);
	
	// ASPX uses span around checkbox, check and correct if neccesary
	if(masterCheckBox.type == "span")
	{
		masterCheckBox = masterCheckBox.children.item[0];
	}
	
	// Iterate through all controls
	for(i=0; i<elements.length;i++)
	{
		// If it is a checkbox and is a child of the container, click it.
		if(elements[i].type == 'checkbox' && elements[i].id.match(regularExpression) && elements[i].checked != masterCheckBox.checked)
		{
			elements[i].click();
		}
	}
}
//-->

