revamped the javascript code to format the device detail section
when a device is clicked in the timeline