var agt = navigator.userAgent.toLowerCase();
var is_netscape = document.layers;
var is_ie = (agt.indexOf("msie") != -1);
var is_konqueror = (agt.indexOf("konqueror") != -1);
var is_netscape7 = (agt.indexOf("netscape") != -1);
var is_mozilla = (agt.indexOf("mozilla") != -1 && agt.indexOf("gecko") != -1);
var is_opera = (agt.indexOf("opera") != -1);

var is_smart = (is_ie || is_mozilla || is_netscape7 || is_konqueror) && !is_opera;

function getObject(sName) {
	return is_ie?eval(sName):document.getElementById(sName);
}

function packItems(oForm, sUrl, sAct) {
    var list = '';
    with(oForm) {
        for(i=0;i<elements.length;i++) {
            if(elements[i].name && elements[i].name.substr(0, 4) == 'chk_' && elements[i].checked) {
                list += elements[i].name.substr(4) + "|";
            }
        }
    }
    list = list.substring(0, list.length - 1);
    if(list != '') {
        window.location.href = sUrl + "act=" + sAct + "&list=" + list;
    }
}

function trim(sValue) {
    var oString = new String(sValue);
	return oString.replace(/(\s)*/g, "");
}

function checkRadio(poRadioGroup) {
	var bChecked = false;
	for(i=0;i<poRadioGroup.length;i++) {
		bChecked = bChecked || poRadioGroup[i].checked;
	}
	return bChecked;
}

function selectByValue(oSel, sVal) {
	var i;
	for (i=0;i<oSel.options.length;i++) {
		if (oSel.options[i].value == sVal) {
			oSel.options[i].selected = true;
		}
	}
}

function openHelp(sCode, sOffset) {
	var wndHelp = window.open(sOffset + "help.php?code=" + sCode, "wndHelp", "top=100,left=100,width=600,height=400,scrollbars=yes");
}

