/* Get elements by className is a javascript function that adds support not offered
natively in JS. This will allow you to get an array of elements in the DOM tree
by their 'class' and by their 'tag'. The class is a CSS class and the tag is the
html tag.

IE: If I wanted to search for all TextBox Inputs on a page with a class of "HoverMe"
I would call teh function as follows: getElemetsByClassName("HoverMe", "input");
This will return an array for processing.

In the case of jumpFocus.js, you can see it uses getElemetsByClassName, to return
an array of all inputs with a class of "keypoint", the script then activates the
'focus' on to this element, allowing the user to jump between different sections
of the form. */

document.getElementsByClassName = function(findClass, findTag) {
    var retnode = [];var myclass = new RegExp('\\b'+findClass+'\\b');
    if (!findTag){var findTag = '*';}
    var elem = this.getElementsByTagName(findTag);
    for (var i = 0; i < elem.length; i++) {
        var classes = elem[i].className;
        if (myclass.test(classes)) retnode.push(elem[i]);}
    return retnode;
};