public static function tooltip($selector = '.hasTip', $params = array())
	{
		$sig = md5(serialize(array($selector, $params)));

		if (isset(self::$loaded[__METHOD__][$sig]))
		{
			return;
		}

		self::framework(true);

		// Setup options object
		/*$opt['maxTitleChars']	= (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int) $params['maxTitleChars'] : 50;
		// offsets needs an array in the format: array('x'=>20, 'y'=>30)
		$opt['offset']			= (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null;
		if (!isset($opt['offset']))
		{
			$opt['offset']		= (isset($params['offsets']) && (is_array($params['offsets']))) ? $params['offsets'] : null;
		}
		$opt['showDelay']		= (isset($params['showDelay'])) ? (int) $params['showDelay'] : null;
		$opt['hideDelay']		= (isset($params['hideDelay'])) ? (int) $params['hideDelay'] : null;
		$opt['className']		= (isset($params['className'])) ? $params['className'] : null;
		$opt['fixed']			= (isset($params['fixed']) && ($params['fixed'])) ? true : false;
		$opt['onShow']			= (isset($params['onShow'])) ? '\\' . $params['onShow'] : null;
		$opt['onHide']			= (isset($params['onHide'])) ? '\\' . $params['onHide'] : null;

		$options = Behavior::getJSObject($opt);*/

		App::get('document')->addScriptDeclaration(
			"jQuery(document).ready(function($){
				$('" . $selector . "').tooltip({
					track: true,
					show: false,
					content: function() {
						return $(this).attr('title');
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText && tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', '<div class=\"tip-title\">' + parts[0] + '</div><div class=\"tip-text\">' + parts[1] + '</div>');
						} else {
							tip.attr('title', '<div class=\"tip-text\">' + tipText + '</div>');
						}
					},
					tooltipClass: 'tool-tip'
				});
			});"
		);

		self::$loaded[__METHOD__][$sig] = true;

		return;
	}
public static function tooltip($selector = '.hasTip', $params = array())
	{
		$sig = md5(serialize(array($selector, $params)));

		if (isset(self::$loaded[__METHOD__][$sig]))
		{
			return;
		}

		self::framework(true);

		// Setup options object
		/*$opt['maxTitleChars']	= (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int) $params['maxTitleChars'] : 50;
		// offsets needs an array in the format: array('x'=>20, 'y'=>30)
		$opt['offset']			= (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null;
		if (!isset($opt['offset']))
		{
			$opt['offset']		= (isset($params['offsets']) && (is_array($params['offsets']))) ? $params['offsets'] : null;
		}
		$opt['showDelay']		= (isset($params['showDelay'])) ? (int) $params['showDelay'] : null;
		$opt['hideDelay']		= (isset($params['hideDelay'])) ? (int) $params['hideDelay'] : null;
		$opt['className']		= (isset($params['className'])) ? $params['className'] : null;
		$opt['fixed']			= (isset($params['fixed']) && ($params['fixed'])) ? true : false;
		$opt['onShow']			= (isset($params['onShow'])) ? '\\' . $params['onShow'] : null;
		$opt['onHide']			= (isset($params['onHide'])) ? '\\' . $params['onHide'] : null;

		$options = Behavior::getJSObject($opt);*/

		App::get('document')->addScriptDeclaration(
			"jQuery(document).ready(function($){
				$('" . $selector . "').tooltip({
					track: true,
					show: false,
					content: function() {
						return $(this).attr('title');
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText && tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', '<div class=\"tip-title\">' + parts[0] + '</div><div class=\"tip-text\">' + parts[1] + '</div>');
						} else {
							tip.attr('title', '<div class=\"tip-text\">' + tipText + '</div>');
						}
					},
					tooltipClass: 'tool-tip'
				});
			});"
		);

		self::$loaded[__METHOD__][$sig] = true;

		return;
	}
public static function tooltip ( $ selector = '.hasTip' , $ params = array ( ) ) { $ sig = md5 ( serialize ( array ( $ selector , $ params ) ) ) ; if ( isset ( self :: $ loaded [ __METHOD__ ] [ $ sig ] ) ) { return ; } self :: framework ( true ) ; // Setup options object /*$opt['maxTitleChars']	= (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int) $params['maxTitleChars'] : 50;
		// offsets needs an array in the format: array('x'=>20, 'y'=>30)
		$opt['offset']			= (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null;
		if (!isset($opt['offset']))
		{
			$opt['offset']		= (isset($params['offsets']) && (is_array($params['offsets']))) ? $params['offsets'] : null;
		}
		$opt['showDelay']		= (isset($params['showDelay'])) ? (int) $params['showDelay'] : null;
		$opt['hideDelay']		= (isset($params['hideDelay'])) ? (int) $params['hideDelay'] : null;
		$opt['className']		= (isset($params['className'])) ? $params['className'] : null;
		$opt['fixed']			= (isset($params['fixed']) && ($params['fixed'])) ? true : false;
		$opt['onShow']			= (isset($params['onShow'])) ? '\\' . $params['onShow'] : null;
		$opt['onHide']			= (isset($params['onHide'])) ? '\\' . $params['onHide'] : null;

		$options = Behavior::getJSObject($opt);*/ App :: get ( 'document' ) -> addScriptDeclaration ( "jQuery(document).ready(function($){
				$('" . $ selector . "').tooltip({
					track: true,
					show: false,
					content: function() {
						return $(this).attr('title');
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText && tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', '<div class=\"tip-title\">' + parts[0] + '</div><div class=\"tip-text\">' + parts[1] + '</div>');
						} else {
							tip.attr('title', '<div class=\"tip-text\">' + tipText + '</div>');
						}
					},
					tooltipClass: 'tool-tip'
				});
			});" ) ; self :: $ loaded [ __METHOD__ ] [ $ sig ] = true ; return ; }
Add unobtrusive javascript support for a hover tooltips.

Add a title attribute to any element in the form
title="title::text"


Uses the core Tips class in MooTools.

@param   string  $selector  The class selector for the tooltip.
@param   array   $params    An array of options for the tooltip.
Options for the tooltip can be:
- maxTitleChars  integer   The maximum number of characters in the tooltip title (defaults to 50).
- offsets        object    The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}).
- showDelay      integer   The millisecond delay the show event is fired (defaults to 100).
- hideDelay      integer   The millisecond delay the hide hide is fired (defaults to 100).
- className      string    The className your tooltip container will get.
- fixed          boolean   If set to true, the toolTip will not follow the mouse.
- onShow         function  The default function for the show event, passes the tip element
and the currently hovered element.
- onHide         function  The default function for the hide event, passes the currently
hovered element.
@return  void
Add unobtrusive javascript support for a hover tooltips .