$(function() {
	$.bindTooltips = function()
	{
		$('span.prom_lm, span.prom_kpd, span.prom_kpr, span.prom_kpr200, span.prom_flight, span.prom_kh, span.prom_kpz, span.prom_kn, span.prom_kw, span.prom_kpdz, span.prom_kpit, span.prom_ks, span.prom_kuro, span.prom_kur1, span.prom_krc, span.prom_keur').tooltip({
			track: true,
			opacity: 1,
			fade: 200,  
			bodyHandler: function() {
				var this_class = '';
				if($(this).hasClass('prom_lm'))
					this_class = 'lm_opis';
				else if($(this).hasClass('prom_kpr'))
					this_class = 'kpr_opis';
				else if($(this).hasClass('prom_kpd'))
					this_class = 'kpd_opis';
				else if($(this).hasClass('prom_kpr200'))
					this_class = 'kpr200_opis';
				else if($(this).hasClass('prom_flight'))
					this_class = 'flight_opis';
				else if($(this).hasClass('prom_kh')) 
					this_class = 'kh_opis';
				else if($(this).hasClass('prom_kpz')) 
					this_class = 'kpz_opis';
				else if($(this).hasClass('prom_kn')) 
					this_class = 'kn_opis';
				else if($(this).hasClass('prom_krc')) 
					this_class = 'krc_opis';
				else if($(this).hasClass('prom_kw')) 
					this_class = 'kw_opis';
				else if($(this).hasClass('prom_kpdz')) 
					this_class = 'kpdz_opis';
				else if($(this).hasClass('prom_kpit')) 
					this_class = 'kpit_opis';
				else if($(this).hasClass('prom_ks')) 
					this_class = 'ks_opis';
				else if($(this).hasClass('prom_kuro')) 
					this_class = 'kuro_opis';
				else if($(this).hasClass('prom_keur')) 
					this_class = 'keur_opis';
				else if($(this).hasClass('prom_kur1')) 
					this_class = 'kur1_opis';
					
				if($(this).hasClass('prom_flight_also') && this_class.length && $('#' + this_class).html())
					$('#' + this_class + ' p.promo_flight_plain').show();
				else
					$('#' + this_class + ' p.promo_flight_plain').hide();
				
	
				return (this_class.length && $('#' + this_class).html()) ? $('#' + this_class).html() : '';
			} 
		});
		
		$('span.price_info').tooltip({
			track: false,
			opacity: 1,
			fade: 200,
			bodyHandler: function() {
				var this_id = $(this).attr('id').replace('price_tooltip_', '');
				return $('#child_price_' + this_id).html();
			}
		});
	};
	
	$.bindTooltips();
});
