IE6+ compatibility

Updated code to support IE6 and up.