Ext.ns( 'App' );

App.TooltipIcon = Ext.extend( Ext.Container, {
	
	icon: '/resources/icons/fugue/information.png',
	title: null,
	text: null,
	anchor: 'left',
	
	initComponent: function() {
		
		var oTooltipIcon = this;
		var oTooltip = null;
		
		Ext.apply( oTooltipIcon, {
			html: '<img src="' + ( oTooltipIcon.icon || '' ) + '" alt="' + ( oTooltipIcon.title || App.util.Translation.get( 'C_TOOLTIP_INFORMATION_TITLE' ) ) + '"></a>',
			
			width: '16px',
			height: '16px'
		} );
		
		oTooltipIcon.on( 'afterrender', function() {
			oTooltip = new Ext.ToolTip( {
				target: oTooltipIcon.getEl(),
				anchor: oTooltipIcon.anchor,
				dismissDelay: 0,
				showDelay: 0,
				hideDelay: 0,
				title: oTooltipIcon.title || App.util.Translation.get( 'C_TOOLTIP_INFORMATION_TITLE' ),
				html: oTooltipIcon.text || App.util.Translation.get( 'C_TOOLTIP_INFORMATION_TEXT' )
			} );
		} );
		
		
		
		App.TooltipIcon.superclass.initComponent.apply( this, arguments );
		
	}
	
} )
