JavaScript helper.