/* This first function($) line is to eliminate the errors thrown on the $ variable above. 
   RE: http://codeimpossible.com/2010/01/13/solving-document-ready-is-not-a-function-and-other-problems */
(function($) {
	// Create the tooltips only on document load
$(document).ready(function() 
{
   /* Use the each() method to gain access to each elements attributes */
   $('#communityBanner a[rel]').each(function()
   {
/*      	alert($(this).attr('rel')); */
   	$(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="/projects/qtip/images/throbber.gif" alt="Loading..." />',
            url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load
            title: {
//             text: $(this).text(), // Give the tooltip a title using each elements text
               button: 'Close' // 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: 'click', 
            solo: true // Only show one tooltip at a time
         },
         hide: 'unfocus',
         style: {
            tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            height:225,  // Set the tooltip width
            padding:0,
            border: {
               width: 0,
               radius: 6,
               color:'#a3d2aa'
            },
            background: '#FFF',
            color: '#000',
            width: 450 // Set the tooltip width
         },
         api: {
         onRender: function() {
            this.elements.tooltip.click(this.hide)
         }
      }   
         
      })
   });
});
// This last line is to eliminate the errors thrown on the $ variable above. RE: http://codeimpossible.com/2010/01/13/solving-document-ready-is-not-a-function-and-other-problems/
})(jQuery);
