Added Javascript functionality.