Write Javascript for pin details page