Added js functions

Added all the functions.