function trim (str) {
	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}

function validateText(fieldId, blnRequired, errLabelId) {
	e = document.getElementById(fieldId);
	errId = errLabelId==null?(fieldId + "-error"):errLabelId;
	eErrMsg = document.getElementById(errId);
	if (blnRequired && (trim(e.value)=="")) {
		if (eErrMsg) eErrMsg.innerHTML = "* this field is required ";
		return false;
	} else {
		if (eErrMsg) eErrMsg.innerHTML = "";
		return true;
	}
}
function formUpdateCheckGroup(selectedCheckBox,altCheckBox) {
	 if (document.getElementById(selectedCheckBox).checked==true) document.getElementById(altCheckBox).checked=false;
}
