Cost tooltip hides properly when mouse leaves

In addition, moved the tooltip.top class up a bit to avoid some annoying
flicker that can occur if the tooltip covers the button too much (the
tooltip now appears the same distance above the button as it normally
does below the tooltip).