Updated Javascript file

Added new functions