seperated javascript from index.html view