css: styles to class; moved javascript call to the bottom