Placed all client-side js code in clientsocket.js