updated style switcher to javascript from PHP

slow