// Create the tooltips only on document load
$(document).ready(function() 
{
   // Notice the use of the each() method to acquire access to each elements attributes
   $('#UpcomingEvents a[tooltip], .day a[tooltip]').each(function()
   {
      $(this).qtip({
         content: {
             text: $(this).attr('tooltip') // Use the tooltip attribute of the element for the content
         },
         show: {
             delay:0,
             length: 0
         },
         position: {
            corner: {
              tooltip: 'leftTop', // Use the corner...
              target: 'bottomRight' // ...and opposite corner
            }
         },
         tip: {
             size: {x:12,y:6},
             color: '#ffffff'
         },
         style: {
            border: {
                width: 1,
                radius: 1,
                color: '#666666'
            },
            width: 180,
            padding: 5,
            textAlign: 'left',
            tip:true
         }
      });
   });
});
