Moved javascript stuff to homeview.js