$(document).ready(function(){
   $('.tooltip').each(function(){
      var id = $(this).attr('id');
     
      var tooltip_content_id = id + "_content";
      
      
      
      var tool_tip_content = $('#' + tooltip_content_id).html();
      if(!tool_tip_content) tool_tip_content = "";
      var tool_tip_title = $('#' + tooltip_content_id).attr('title');
      if(!tool_tip_title) tool_tip_title = "";
      
      
     // alert(id + " / " + tooltip_content_id + " / " + tool_tip_title + " / " + tool_tip_content);
  
      $(this).qtip({
	      content: {
	                   text: tool_tip_content,
		               title: { 
		                  text: tool_tip_title
		               } 
		   },
	      position: {
	         corner: {
	           	target: 'topRight',
				tooltip: 'bottomLeft'
	         },
			adjust: {
			        screen: true
			}
	
	      },


	      style: {
	                 width:{
	                  max:400,
	                  min:0
	                 },
	                  border: {
	                     width: 5,
	                     radius: 10
	                  },
	                  padding: 10, 
	                  textAlign: 'left',
	                  tip: true, // Give it a speech bubble tip with automatic corner detection
	                  name: 'light' // Style it according to the preset style (ex light, dark,green, etc)
	       }

	   });

  });


});
