if (!this.Rf) this.Rf = {};
(function(ns, $) {

ns.Require('Tooltip', ns);

/**
 * Tooltip class that displays content embedded on the page
 * @param {Object} owner jQuery selector of the object to whom the tooltip pertains
 * @param {Object} contentSelector jQuery selector of the content that will be placed in the tooltip
 * @param {Object} options Settings used to initialize the tooltip
 */
ns.EmbeddedTooltip = function(owner, contentSelector, options) {
	ns.Tooltip.call(this, owner, options);
	if (contentSelector) this.ContentSelector = contentSelector;
};
ns.EmbeddedTooltip.prototype = new ns.Tooltip(null, {
	constructor : ns.EmbeddedTooltip,
	/**
	 * jQuery select of the content that will be placed in the tooltip
	 */
	ContentSelector : '.tooltip-content:first',
	/**
	 * Copies the content out of the embedded container
	 * @param {Function} callback A function that is executed using the acquired data
	 */
	AcquireContent : function(callback) {
		var content = (typeof this.ContentSelector == 'string') ? this._Owner.find(this.ContentSelector) : $(this.ContentSelector);
		callback.call(this, content.html());
		$('#' + this.ID).html(content.html());
		return this;
	}
});

})(Rf, jQuery);

