        function checklistservices(frm)
        {   // checklistservices
            return true;
        }   // checklistservices

        function checkaddservices(frm)
        {   // checkaddservices
            var     index = document.addService.servicekey.selectedIndex;
            var     newservice = TrimString(document.addService.newservice.value);
            var     serviceinfo = TrimString(document.addService.serviceinfo.value);
            var     retval = true;

            //var       serviceinfo = document.addService.serviceinfo.value;

            //alert("serviceinfo is [" + serviceinfo + "]\n" +
            //      " is [" + newservice + "]");
            //return false;
            if (0==newservice.length && -1==index)
                {
                alert("Please select an existing service or enter a new one");
                //frm["addService"].focus();
                retval = false;
                }

            if (0!=newservice.length && -1!=index)
                {
                alert("Please select an existing service or enter a new one\n\nNOT BOTH");
                //frm["addService"].focus();
                retval = false;
                }

            if (10>=serviceinfo.length)
                {
                alert("Your service description should exceed 10 characters");
                retval = false;
                }
// now that we have the proper parameters, let's massage them a bit
            document.addService.newservice.value = newservice;
            document.addService.serviceinfo.value = serviceinfo;

            return retval;
        }   // checkaddservices

function checkNumeric(str)
{   // checkNumeric
    var     numericPattern = /^([0-9]+)$/;

    //alert("checkNumeric of " + str );

    if (-1 == str.search(numericPattern))
        return false;
    else
        return true;
}   // checkNumeric

function TrimString(xxx)
{   // TrimString
//alert("TrimString");
    if("string" == typeof xxx)
        {
        xxx = xxx.replace(/^\s+/, "");
        xxx = xxx.replace(/\s+$/, "");
//alert("TrimString2 " + xxx);
        }
    else
    if("object" == typeof xxx)
        {
//alert("TrimString3");
        xxx.value = xxx.value.replace(/^\s+/, "");
        xxx.value = xxx.value.replace(/\s+$/, "");
        }

    return xxx;

}   // TrimString

