Implemented global approach to assigning focus to an element.