function isWhitespace(s) {
//Function tests if only white space exists.
        var whitespace = " \t\n\r";
        for(var i = 0; i < s.length; i++) {
                // Check that current character isn't whitespace.
                if (whitespace.indexOf(s.charAt(i)) == -1) return false;
        }
        return true;
}
  
function hasWhitespace(s) {
        var whitespace = " \t\n\r";
        for(var i = 0; i < s.length; i++) {
                // See if the current character is whitespace.
                if (whitespace.indexOf(s.charAt(i)) != -1) return true;
        }
        return false;
}