Hack javascript to support IE8