$.fn.extend({
	tooltip : function(string, width) {
		this.each(function() {
			$(this).hover(function() {
				$(this).bind("mousemove", update);
				
				$("#tooltip").html(string);
				
				$("#tooltip").css({"width": width});
				$("#tooltip").show();
			}, function() {
				$(this).unbind("mousemove", update);
				$("#tooltip").hide();
			});
			
			$(this).click(function() {
				$(this).unbind("mousemove", update);
				$("#tooltip").hide();
			});
        });
    }
});
function update(event) {
	$("#cms_tooltip").css({"left": event.pageX + 5});
	$("#cms_tooltip").css({"top": event.pageY + 5});
	$("#tooltip").css({"left": event.pageX + 5});
	$("#tooltip").css({"top": event.pageY + 5});
}
