function isEmpty(value) {
    if (value == null)
        return true;
    else
        return (new String(value).match(/^[ \t]*$/) != null);
}

function nvl(value, value_null) {
    return (value == null) ? value_null : value;
}

function isEmail(value) {
    return (new String(value).match(/\b(^(\S+@).+(\.\S{2,})$)\b/gi) != null);
}

function isUsemap(value) {
    return (new String(value).match(/^#[a-z0-9_]+$/gi) != null);
}

function isId(value) {
    return (new String(value).match(/^[a-z_][a-z0-9_]*$/gi) != null);
}

function isUint(value) {
    return (new String(value).match(/^[0-9]*$/gi) != null);
}

function isPin(value) {
    return (new String(value).match(/^[0-9][0-9][0-9][0-9]$/gi) != null);
}

function parse_file_name(path) {
    var pos;
    var strFileName = new String(path);
    if ((pos = strFileName.lastIndexOf("/")) >= 0)
        strFileName = strFileName.substr(pos + 1);
    if ((pos = strFileName.lastIndexOf("\\")) >= 0)
        strFileName = strFileName.substr(pos + 1);
    if ((pos = strFileName.indexOf(".")) >= 0)
        strFileName = strFileName.substr(0, pos);
    return strFileName;
}

function trim(value, delim) {
    var i = 0;
    if (!delim)
        delim = new String(" ");
    while (i <= value.length - 1 && delim.indexOf(value.charAt(i)) != -1)
        i++;
    value = value.substring(i);
    var i = value.length - 1;
    while (i >= 0 && delim.indexOf(value.charAt(i)) != -1)
        i--;
    value = value.substring(0, i + 1);
    return value;
}

function getElement(s, n, d) {
    var pos_1 = 0;
    var pos_2;
    if (n < 1)
        return "";
    for (var i = 0; i < n - 1; i++) {
        pos_2 = s.indexOf(d, pos_1);
        if (pos_2 == -1)
            return "";
        pos_1 = pos_2 + 1;
    }
    pos_2 = s.indexOf(d, pos_1);
    if (pos_2 == -1)
        pos_2 = s.length;
  // alert("s="+s+" n="+n+" pos_1="+pos_1+" pos_2="+pos_2);
    return s.substring(pos_1, pos_2);
}


 
