Move pos js to .js file