jQuery 1.5 compatibility

Added compatibility with jQuery 1.5 by replacing .on events with .bind
events