Here is a demo of dynamic CSS in javascript. It contains a file, dcss.js, you can use to manipulate CSS by adding rules, changing rules, adding entirely new stylesheets, whatever.