moving pan and zoom script to separate js file