function popWnd(url, w, h, sc) {
	var tp = (screen.availHeight - h) / 2;
	var lt = (screen.availWidth - w) / 2;
	var wndprops = "location=0,menubars=0,resizable=0,scrollbars=" + sc + ",status=0,titlebar=1,toolbar=0,top=" + tp + ",left=" + lt + ",height=" + h + ",width=" + w;
	window.open(url, "", wndprops);
	return false;
}

function popupWindow(url, w, h) {
	return popWnd (url, w, h, 0);
}

function popupScrollableWindow(url, w, h) {
	return popWnd (url, w, h, 1);
}

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;
}

