Adding some JS functions