/**
 * Tooltips initialization
 */
$(document).ready(function() {
	//- be sure to add only once
	if ($(".tooltip").length == 0){
		$('body').prepend('<div class=tooltip></div>');
	}	
	// select all desired input fields and attach tooltips to them, do by delegate to by sure to show tooltips in ajax dialogs
	$(document).delegate("form :input[title]:not(.tip-init)","mouseenter",function(){
		$(this).tooltip({
			// place tooltip on the right edge
			position: "center right",
			// a little tweaking of the position
			offset: [-2, 10],
			// use the built-in fadeIn/fadeOut effect
			effect: "fade",
			predelay:200, // dont remove needed to fix blinking of tooltipss
			delay:200,// dont remove needed to fix blinking of tooltipss
			// custom opacity setting
			opacity: 0.9,
			// use this single tooltip element
			tip: '.tooltip'
		}).dynamic({
			bottom: {
				direction: 'center left'
			}
		});
		$(this).trigger("mouseenter");
		$(this).addClass("with-tip");
	});

});



