function selectOptionByValue(selectObj, optval) {
	optval = '' + optval;
	for (i = 0; i < selectObj.options.length; i++) {
		if (selectObj.options[i].value == optval) {
			selectObj.selectedIndex = i;
			break;
		}
	}
}

function getSelectedValue(selectObj) {
	if (selectObj.selectedIndex == null) {
		return null;
	}
	return selectObj.options[selectObj.selectedIndex].value;
}

function empty(value) {
	return (value == null || value == 0 || value == '');
}

function showDiv(div_id) {
	dstyle = document.getElementById(div_id);
	dstyle.style.display = 'block';
}

function hideDiv(div_id) {
	dstyle = document.getElementById(div_id);
	dstyle.style.display = 'none';
}

function divOnOff(div_on, div_off) {
	hideDiv(div_off);
	showDiv(div_on);
}

// vim: set ai noet ts=2 sw=2 filetype=javascript:
