// Functions to include a throbber image when an action takes place on a page.

// Throbber Over Form Buttons (One or Two Buttons)
// In code beside buttons, add this tag:
//		<img id="ThrobberImage" src="/images/throbbers/small.gif" style="display:none;" alt="Form Being Submitted" />
function showThrobberTwoButtons(buttonOneId, buttonTwoId, throbberImageId) {
	document.getElementById(buttonOneId.id).style.display="none";
	document.getElementById(buttonTwoId.id).style.display="none";
	document.getElementById(throbberImageId.id).style.display="block";
}

function showThrobberOneButton(buttonOneId, throbberImageId) {
	document.getElementById(buttonOneId.id).style.display="none";
	document.getElementById(throbberImageId.id).style.display="block";
}

// Throbber Over Div
// In code, add this at end of page:
//		<div id="Overlay" stlye="visibility: hidden;"></div>
function showThrobberOverDiv(divIdToCover, overlayDivId) {
	var contentDiv = document.getElementById(divIdToCover);
	var overlayDiv = document.getElementById(overlayDivId);
	
	overlayDiv.style.width = contentDiv.offsetWidth + "px";
	overlayDiv.style.height = contentDiv.offsetHeight + "px";
	
	var currentLeft = currentTop = 0;
	if (contentDiv.offsetParent) {
		currentLeft = contentDiv.offsetLeft;
		currentTop = contentDiv.offsetTop;
		while (contentDiv = contentDiv.offsetParent) {
			currentLeft += contentDiv.offsetLeft;
			currentTop += contentDiv.offsetTop;
		}
	}
	
	overlayDiv.style.top = currentTop + "px";
	overlayDiv.style.left = currentLeft + "px";
		
	overlayDiv.style.visibility = "visible";	
	
}