Tidying up recent changes re tabs

tagDragMouseXStart should be tabDragMouseXStart
Ensuring vars are defined at top of function & in usage order
Forgot a var in the foor loop