$(document).ready(function() 
{
   $('#content a[rel]').each(function()
   {
      $(this).qtip(
      {
         content: {
            // Set the text to an image HTML string with the correct src URL to the loading image you want to use
            text: '<img class="throbber" src="ajax-loader.gif" alt="Loading..." />',
            url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load
            title: {
               text: 'Wikipedia - ' + $(this).attr('rev'), // Give the tooltip a title using each elements text
               button: 'X' // Show a close link in the title
            }
         },
         position: {
            corner: {
               target: 'bottomMiddle', // Position the tooltip above the link
               tooltip: 'topMiddle'
            },
            adjust: {
               screen: true // Keep the tooltip on-screen at all times
            }
         },
         show: { 
            when: 'mouseover', 
            solo: true // Only show one tooltip at a time
         },
         hide: { when:'mouseout',fixed:true },
          style: {
             width: 200,
      		 padding: 5,
    		 background: '#43442D',
      		 color: 'white',
      		 textAlign: 'center',
      		 border: {
         		width: 7,
         		radius: 5,
         		color: '#FEFEC3'
     		},
            tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            name: 'dark', // Use the default light style
            width: 570 // Set the tooltip width
         }
      })
   });
});

