further jquery work; also move vars closer to sole usage area