//this function is usually used where we have a submit button that needs to disable all other buttons
//when pressed. On the form, the button that we want to execute is hidden but enabled and an HTML button
//is visible in its place. When the HTML button is pressed it calls the click event of the hidden server button.
function DisableAllControls(controlEnabledID)
{
	//this is the control we want to keep anabled
	var controlEnabled = document.getElementById(controlEnabledID);
	
	//get all elements from the form
	var count = document.forms[0].elements.length;
	for (i=0; i<count; i++) 
	{
		var element = document.forms[0].elements[i];
		//if element is not part of the breadcrumb control
		if(element.id.indexOf('pagebc')==-1)
		{
			//if element is not hidden (for breadcrumb textboxes or any other non-visible control)
			if(element.type!='hidden')
			{
				//if element is not the control we want to keep enabled, disable it
				if(controlEnabled!=element)
				{
					if(element.type=='text')
					{
						element.readOnly=true;	
					}
					else
					{
						element.disabled=true; 
					}
				}
			}
		}

	}
}
