function findElement(target, search, reverse /* optional */)
    {
        if (target == null)
            return null;

        var nodes			= reverse != true ? target.childNodes : [ target.parentNode ],
            propertyToFind	= { '#' : 'id', '.' : 'className' }[search.substr(0, 1)] || 'nodeName',
            expectedValue,
            found
            ;

        expectedValue = propertyToFind != 'nodeName'
            ? search.substr(1)
            : search.toUpperCase()
        ;

        // main return of the found node
        if ((target[propertyToFind] || '').indexOf(expectedValue) != -1)
            return target;

        for (var i = 0; nodes && i < nodes.length && found == null; i++)
            found = findElement(nodes[i], search, reverse);

        return found;
    }
Looks for a child or parent node which has specified classname.
Equivalent to jQuery's $(container).find(".className")
@param {Element} target Target element.
@param {String} search Class name or node name to look for.
@param {Boolean} reverse If set to true, will go up the node tree instead of down.
@return {Element} Returns found child or parent element on null.