function OpenWindow(URL, ID, Width, Height, Resizable, ToolBar, MenuBar, Scrollbar, Location, Directories, Status) {
	(Resizable == true) ? Resizable = 'yes' : Resizable = 'no';
	(ToolBar == true) ? ToolBar = 'yes' : ToolBar = 'no';
	(MenuBar == true) ? MenuBar = 'yes' : MenuBar = 'no';
	(Scrollbar == true) ? Scrollbar = 'yes' : Scrollbar = 'no';
	(Location == true) ? Location = 'yes' : Location = 'no';
	(Directories == true) ? Directories = 'yes' : Directories = 'no';
	(Status == true) ? Status = 'yes' : Status = 'no';
	var objWindow = window.open(URL, ID, 'width='+Width+', height='+Height+', left=' +((window.screen.width / 2) - ((Width / 2) + 10))+', top='+((window.screen.height / 2) - ((Height / 2) + 25))+', toolbar='+ToolBar+', menubar='+MenuBar+', scrollbars='+Scrollbar+', resizable='+Resizable+', location='+Location+', directories='+Directories+', status='+Status);
	objWindow.focus();
	return objWindow;
}

function ToggleCheckBoxes(InputID, InputName) {
	if(!document.getElementById){ return(false); }
	if(!document.getElementsByName){ return(false); }
	var objInput = document.getElementById(InputID);
	var objInputs = document.getElementsByName(InputName);
	if(objInput && objInputs) {
		if(objInput.type == 'checkbox') {
			for(var i = 0; i < objInputs.length; i++) {
				if(objInputs[i].type == 'checkbox') {
					objInputs[i].checked = objInput.checked;
				}
			}
		}
	}
}

function CheckInputLength(InputValueID, InputSizeID, InputMaximumLength) {
	if(!document.getElementById){ return(false); }
	var objInputValue = document.getElementById(InputValueID);
	var objInputSize = document.getElementById(InputSizeID);
	if(objInputValue && objInputSize) {
		objInputValue.value = objInputValue.value.replace(/[\x00-\x1F\x80-\xFF]/, '');
		objInputValue.value = objInputValue.value.toUpperCase();
		if(objInputValue.value.length > InputMaximumLength) {
			objInputValue.value = objInputValue.value.substring(0, InputMaximumLength);
			objInputValue.blur();
			objInputValue.focus();
			return(false);
		} else {
			objInputSize.innerHTML = InputMaximumLength - objInputValue.value.length;
		}
	}
}
