added full cross-browser compatability