Javascript scope tweaking.