//This will give focus to a specific control
function FocusControl(ControlID)
{
	//Focus on one of the controls:
	var objFirstControl = document.getElementById(ControlID);
	if(objFirstControl != null)
		objFirstControl.focus()
}

function HideControl(ControlID)
{
	var objControlToHide = document.getElementById(ControlID);
	if(objControlToHide != null)
		objControlToHide.style.display = 'none';
}

function ShowControl(ControlID)
{
	var objControlToShow = document.getElementById(ControlID);
	if(objControlToShow != null)
		objControlToShow.style.display = "";
}

//This will resize and image to a maximum size
function ScaleImage(imgImage, maxWidth)
{
	if(imgImage.clientWidth > maxWidth)
		imgImage.width = maxWidth;
}

//Show or hide a Div
function ShowHideDiv(strDivID)
{
	var objDiv = document.getElementById(strDivID);
	if(objDiv != null)
	{
		if(objDiv.style.display == 'none')
			objDiv.style.display = '';
		else
			objDiv.style.display = 'none';
	}
}

function VerifyFilledIn(ControlID, ErrorMessage)
{
	var objControl = document.getElementById(ControlID);
	if(objControl && objControl.value == '')
	{
		alert(ErrorMessage);
		objControl.focus();
		return false;
	}

	return true;
}
