Hi, Can somebody help me complete this calendar function I have built in jQuery it is taking me a long time to know how event binding works. (without using jQuery live plugin which I really dont want to use).

Code JavaScript:
(function($) {
 
	$.fn.calendar = function(options) {
 
		// default options to set up the calendar
		var defaults = {
    		calendar_div: '#calendar_container', 
			events_div: '#ajax_viewing_events'
  		};
 
		var opts 		= $.extend(defaults, options);
		var cal_h		= $(opts.calendar_div).height();
		var cal_w		= $(opts.calendar_div).width();
		var mark_h		= this.height();
		var mark_w		= this.width();
		var ibody_width = $(document).width();
		var ipadding	= 50;
 
		var loading_html    = '<div class="loading"><p><img src="mydomainname.org/cake-sandbox/img/ajax-loader.gif"></p><p>Loading Events...</p></div>';
		$('<div id="' + opts.events_div.substring(1, opts.events_div.length) + '">' + loading_html + '</div>').appendTo('body').hide();
 
		this.each(function() {
			var $this = $(this);
			var calMouseMove = $this.hover(
			      function () {	
				  	// Remove the title so it doesn't detract anything
				  	$this.removeAttr("title");			  	
 
				    $this.mousemove(function(e){
						var x = e.pageX;
						var y = e.pageY;
						var idiv_width = $(opts.events_div).width();
 
						// Boundries if the calendar is on the left hand side	
						if (idiv_width + ipadding + x > ibody_width) {
							x = x - (idiv_width + ipadding);
						}
						$(opts.events_div).css("top", y + mark_h);
						$(opts.events_div).css("left", x + mark_w);
				    });					
 
				    $(opts.events_div).show();
				    $.get('/cake-sandbox/calendar/events/view_day/' + $this.html(), function(data) {
					    $(opts.events_div).html(data);
				    });
 
			      }, 
			      function () {
				    $(opts.events_div).html(loading_html).hide();
			      }
			);			
		});
	};
 
})(jQuery);
 
function change_month(class) {
	class = class.replace(/goto_/i, "");
	$("#calendar_container").prepend("Loading...");
	$.get('/cake-sandbox/calendar/events/ajax_change_month/' + class, function(data){
		$("#calendar_container").html(data);
	});
	return false;
}

The trouble is when change_month has been called the ajax reloaded the content of the calendar and the hover function no longer works which is in the document ready.

I want to step away from placing onclick events onto the html tags. If that makes sense.

Any help would be briill

Thanks