Rewritten to use built in document.styleSheets