added event handlers to js
finished js code, added ID tags, changed js code structure