moved most js to external file
added index page functions to the file
initial upload
alterations
renamed events

for easier undertstanding