function popupWindow(url, wt, ht){return popWnd(url, wt, ht, 'no');}

function popupScrollableWindow(url, wt, ht){return popWnd(url, wt, ht, 'yes');}

function popWnd(locUrl, wt, ht, sb)
{
	var tp = (screen.availHeight - ht) / 2;
	var lp = (screen.availWidth - wt) / 2;
	var wndProps = 'location=no,menubars=no,resizable=no,scrollbars='+sb+',status=yes,titlebar=no,toolbar=no,top='+tp+',left='+lp+',height='+ht+',width='+wt;
	window.open(locUrl, '', wndProps);
	return false;
}

function setStatus(txt){window.status=txt;return true;}

function CheckAll (ChkFormName, ChkNameFilter, ChkState, ChkMode)
{
	// Sets all of the checkbox.
	var counter;
	for (counter = 0; ChkFormName.elements[counter] != null; counter++)
	{
		if (('checkbox'.indexOf(ChkFormName.elements[counter].type)) != -1)
		{
			if ((ChkFormName.elements[counter].name.substring(0,ChkNameFilter.length)) == ChkNameFilter)
			{
				var found = true;
				if (ChkMode)
					found = (ChkFormName.elements[counter].value.substring(0,1) == ChkMode);

				if (found)
					ChkFormName.elements[counter].checked = ChkState;
				else
					ChkFormName.elements[counter].checked = !ChkState;
			}
		}
	}
	return false;
}

function $(ctrlId)
{
	if (arguments.length > 1)
	{
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
			elements.push($(arguments[i]));
		return elements;
	}
	return document.getElementById(ctrlId);
}

