function trimString(strValue) {
	if (strValue == null || strValue == '') return '';
	return strValue.replace(/^\s*/, '').replace(/\s*$/, '');
}


function changeFeedbackValue(obj, idTDHtml, values) {
	var o = document.getElementById(idTDHtml);
	o.innerHTML = values[obj.selectedIndex];
}


function deleteConfirm(message) {
	var agree = confirm(message);
	return agree;
}

function random(range) {
	var index = Math.floor(Math.random() * (range+1));
	if (index == 0) index = 1;
	if (index > range) index = range;
	return index;
}


function getObjectByName(name) {
	var obj = document.getElementsByName(name);
	if (obj == null || obj.length == 0) return null;
	return obj[0];
}

function startWith(strValue, valueWith) {
	if (strValue == null || strValue == '') return false;
	return strValue.match(valueWith) != null;
}

function commonUndefined(obj) {
	if (window.isUndefined) return isUndefined(obj);
	return typeof(obj) == "undefined";
}

function goToAncor(ancor) {
	var id = ancor;
	id = id.substr(id.indexOf('#') + 1);
	var obj = document.getElementById(id);
	if (! commonUndefined(obj) && obj != null) {
		obj.scrollIntoView(true);
	}
	return false;
}
