added cross-browser support.