/**
 * 
 */

function tooltipDoForEvery() {
	$.each($(".ray_cutetooltip"), function(index, tab){

		$(document).append('<div id="leng_helper" style="display: inline-block;"></div>');

		var subs = $(tab).find(".qmark");
		
		if(subs.length < 1 ) {
			$(tab).append('&nbsp;&nbsp;<span class="qmark">&nbsp;</span>');
			var tooltipmsg = $(tab).attr('tip');

			$('#leng_helper').html(tooltipmsg);
			var contwidth = $('#leng_helper').width();

			var currentWidth = $(tab).width();

			if(contwidth > 0)  {
				if(contwidth + 35 > currentWidth) {
					currentWidth = contwidth + 35 ;
				}
				
				$(tab).width(currentWidth);
			}
		}
		
		$(tab).find(".qmark").tooltip({ 
			track: true, 
			delay: 0, 
			showURL: false, 
			bodyHandler: function() {
				return tooltipmsg;
			}, 
			fade: 200 
		});
		
		$('#leng_helper').remove();

	});
}

$(document).ready(function() {

	tooltipDoForEvery();
	
});
