Added javascript functions