move main script to /js/main.js
Moved main script in camera.html to here