function validateLessEqual(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oLessEqual = new lessequal();
    var formName = form.getAttributeNode("name");

    oLessEqual = eval('new ' + formName.value + '_LessEqualValidations()');
    for (x in oLessThan ) {
        var field = form[oLessEqual[x][0]];
        var secondField = form[oLessEqual [x][2]("secondProperty")];
    
        if (field.type == 'text' ||
            field.type == 'textarea' ||
            field.type == 'select-one' ||
            field.type == 'radio' ||
            field.type == 'password') {
    
            var value;
            var secondValue;
            // get field's value
            if (field.type == "select-one") {
                var si = field.selectedIndex;
                value = field.options[si].value;
                secondValue = secondField.options[si].value;
            } else {
                value = field.value;
                secondValue = secondField.value;
            }
            
            var dValue = parseFloat(value);
            var dValue2 = parseFloat(secondValue);
        
            if ( isNaN(dValue) || isNaN(dValue2) || dValue >= dValue2 ) {
            
                if (i == 0) {
                    focusField = field;
                }
                fields[i++] = oLessEqual[x][1];
                bValid = false;
            }
        }
    }
    
    if (fields.length > 0) {
        focusField.focus();
        alert(fields.join('\n'));
    }
    
    return bValid;
}

