public static function caption($selector = 'img.caption')
	{
		if (isset(self::$loaded[__METHOD__][$selector]))
		{
			return;
		}

		self::framework(true);

		App::get('document')->addScriptDeclaration(
			"jQuery(document).ready(function($){
				$('" . $selector . "').tooltip({
					position: {
						my: 'center bottom',
						at: 'center top'
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', parts[1]);
						}
					},
					tooltipClass: 'tooltip'
				});
			});"
		);

		// Set static array
		self::$loaded[__METHOD__][$selector] = true;
	}
public static function caption($selector = 'img.caption')
	{
		if (isset(self::$loaded[__METHOD__][$selector]))
		{
			return;
		}

		self::framework(true);

		App::get('document')->addScriptDeclaration(
			"jQuery(document).ready(function($){
				$('" . $selector . "').tooltip({
					position: {
						my: 'center bottom',
						at: 'center top'
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', parts[1]);
						}
					},
					tooltipClass: 'tooltip'
				});
			});"
		);

		// Set static array
		self::$loaded[__METHOD__][$selector] = true;
	}
public static function caption ( $ selector = 'img.caption' ) { if ( isset ( self :: $ loaded [ __METHOD__ ] [ $ selector ] ) ) { return ; } self :: framework ( true ) ; App :: get ( 'document' ) -> addScriptDeclaration ( "jQuery(document).ready(function($){
				$('" . $ selector . "').tooltip({
					position: {
						my: 'center bottom',
						at: 'center top'
					},
					create: function(event, ui) {
						var tip = $(this),
							tipText = tip.attr('title');

						if (tipText.indexOf('::') != -1) {
							var parts = tipText.split('::');
							tip.attr('title', parts[1]);
						}
					},
					tooltipClass: 'tooltip'
				});
			});" ) ; // Set static array self :: $ loaded [ __METHOD__ ] [ $ selector ] = true ; }
Add unobtrusive javascript support for image captions.

@param   string  $selector  The selector for which a caption behaviour is to be applied.
@return  void
Add unobtrusive javascript support for image captions .