added js for handling links