//File: js_com_functions.js
//Purpose:  Common javascript functions that can be shared throughout site.
//Modificaiton History:
//Who When       Description of changes.
//------------------------------------------------------------
//JR  8/16/2002  Initial creation

function set_focus(frm,objt) {
  objt.focus();
}

function set_select(frm,objt) {
  objt.select();
}

function isLetterOrDigit (c)
{   return (isLetter(c) || isDigit(c))
}

// Returns true if character c is a digit (0 .. 9).
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

function isLetterOrSpace (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) || c == " ")
}

// Returns true if string s is whitespace characters only.
function isWhitespace (s) {   
    var i;
    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++) {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    // All characters are whitespace.
    return true;
}
