Create global.js

it contains global variable and functions