

String.prototype.f_trim = function(){
    return this.replace(/^\s+|\s+$/g, '');
}
String.prototype.f_ltrim = function(){
    return this.replace(/^\s+/, '');
}
String.prototype.f_rtrim = function(){
    return this.replace(/\s+$/, '');
}

function f_empty(str){
    return str.f_trim() == '';
}

function salsel_fix(obj){
    if ($(obj).selectedIndex > 1) {
        if ($(obj).identify() == 'JobSalaryLowerbound' &&
        $('JobSalaryUpperbound').selectedIndex > 1 &&
        $('JobSalaryUpperbound').selectedIndex > 1 &&
        $(obj).selectedIndex > $('JobSalaryUpperbound').selectedIndex) {
            $('JobSalaryUpperbound').selectedIndex = 6;
            alert('Min salary must be less than Max salary!');
        }
        else 
            if ($(obj).identify() == 'JobSalaryUpperbound' &&
            $('JobSalaryLowerbound').selectedIndex > 1 &&
            $(obj).selectedIndex <= $('JobSalaryLowerbound').selectedIndex) {
                $('JobSalaryLowerbound').selectedIndex = 1;
                alert('Max salary must exceed Min salary!');
            }
    }
}
