Separated browser detect and create a simple function for add class on h...

...tml, and tested it.

This PR fixes is the javascript part of the task: #1257

In other Pull request(#1315) I send stylesheet fix