Tweak javascript for better overlay alignment