//
// tooltip() is a tooltip widget. It requires the element that has the tooltip to reference
// the tooltip via aria-describedby. Normally this is a div that contains text
//
// @param ($id object) $id is the jquery object of the input or other element to bind the widget to
//
// @return N/A
//
function tooltip($id) {

// define the object properties

this.$id = $id;
this.$tip = $('#' + $id.attr('aria-describedby'));
this.mouseover = false; // set to true of the tooltip was displayed via mouseover. reset on mouseout
this.focus = false; // set to true of the input has focus (prevent hide on mouseout)
this.dismissed = false; // set to true of the user dismissed the tooltip with the esc key. Reset on blur

//
// function handleMouseOut() is a member function to hide the tooltip on mouseout. If the
// input has focus and the user did not dismiss the tooltip, the tooltip is not hidden.
//
// @param ($id object) $id is the jquery object of the element firing event
//
// @param (e object) e is the event object associated with the event
//
// @return (boolean) returns false
//
tooltip.prototype.handleMouseOut = function($id, e) {