New javascript with bugfixes, css fixes and comments on script