/* focus on a text field */
function mbr_focus (myField)
{
	document.getElementById(myField).focus();
}

/* popup window */
function mbr_popup (page, win, mywidth, myheight)
{
	open(page, win, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + mywidth + ',height=' + myheight);
}

/* focus on first text box */
function mbr_onload (myField)
{
	if (document.forms[0])
		document.forms[0].elements[0].focus();
	if (myField != '')
		document.getElementById(myField).focus();
}

/* disable submit buttons */
function mbr_disable (obj)
{
	obj.value = 'Please wait...';
	obj.disabled = true;
	obj.form.submit();
}

/* confirmation message */
function mbr_confirm (str)
{
	if (str == 0)
		str = 'Warning: This action cannot be reversed. Do you want to continue?';
	return (confirm(str)) ? true : false;
}

/* hides all elements defined by class */
function mbr_hideClass (theClass)
{
	// populate the array with all the page tags
	var allPageTags = document.getElementsByTagName("*");
	// cycle through the tags using a for loop
	for (i = 0; i < allPageTags.length; i++)
		// pick out the tags with our class name
		if (allPageTags[i].className.indexOf(theClass) >= 0)
		{
			// hide/show it
			if (allPageTags[i].style.visibility == 'visible')
				allPageTags[i].style.visibility = 'hidden';
			else
				allPageTags[i].style.visibility = 'visible';
		}
}