JavaScript polyfill for the html5 details element