removed old reference to TR
consider right border width for cell preview location, in rtl mode
use ready function
use float right to detect direction
refactor selected TH variable name