Adding mouseover and click events to lines