Create main.js

Javascript main functions