added a javascript function, afternoon commit.