function isListboxSelected(oForm, iElementIdx, sElementName, sMessage) {

//------------------------------------------------------------------
// isListboxSelected
//
// Determine if a listbox has been selected (not "-"). Prompt
// default error message or pass in one. 
//------------------------------------------------------------------

    with (oForm.elements[iElementIdx]) {

        if (type == "select-one") {
            // do validation only when it is a listbox (and not a hidden field)

            if (options[selectedIndex].value == "-") {
                focus();

                if (sMessage == "") {
                    alert("Please select an item for " + sElementName + " field.");
                } else {
                    alert(sMessage);
                }
                        
                return false;
            }
        }    
        	    
        return true;
    }
}  