Try this, Stacks. Basically, it grabs the title of the window when you press the XButton2 on your mouse. It then finds the position of the "$" sign in the title, takes 3 places off it, which just leaves the table name, and adds "overlay" to the end. Then it sends the control click. I've given it a quick test, but let me know if you have any problems.

Code:
XButton2::
MouseGetPos,,,tableID
WinGetTitle, title, ahk_id %tableID%
IfNotInString, title, overlay
{
   StringGetPos, move_pos, title, $
    move_pos:=move_pos-3
     StringLeft, title, title, %move_pos%
      title=%title%overlay
       ControlClick, x368 y126, %title%
} else
ControlClick, x368 y126, %title%
return