/*
## FAZ UMA BUSCA NO WIKIPEDIA
###############################
###############################
*/
// Create the tooltips only on document load
$(document).ready(function() 
{
   // Use the each() method to gain access to each elements attributes
   $('#calendarioaaa a[title]').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: $(this).attr('title'),
            url: false, // Use the rel attribute of each element for the url to load
            title: {
               text: 'Calendario Animes Brasil', // Give the tooltip a title using each elements text
               button: 'Fechar' // 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: 'unfocus',
         style: {
            tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            border: {
               width: 0,
               radius: 4
            },
            name: 'dark', // Use the default light style
            width: 300 // Set the tooltip width
         }
      })
   });
});


/*
## COLOCA EDIT E DELETA NAS IMG
###############################
###############################
*/
// Only create tooltips when document is ready
$(document).ready(function()
{
   // Use the each() method to gain access to each of the elements attributes
   $('#dasdasdada img[alt]').each(function()
   {
	   // Create image content using websnapr thumbnail service
      var content = '<a href="arquivo/noticias/not_';
      content += $(this).attr('alt');
      content += '_g.jpg" class="lkp" title="apliar">';
	  content += 'Ampliar';
	  content += '</a>';
	  
      $(this).qtip(
      {
         content: content, // Give it some content
         position: 'rightBottom', // Set its position
         hide: {
            fixed: true // Make it fixed so it can be hovered over
         },
         style: {
            padding: '5px 15px', // Give it some extra padding
            name: 'dark' // And style it with the preset dark theme
         }
      });
   });
});


/*
## FAZ UM website thumbnails DO SITE
###############################
###############################
*/
// Create the tooltips only on document load
$(document).ready(function() 
{
   // Notice the use of the each method to gain access to each element individually
   $('#asdasdasda a').each(function()
   {
      // Create image content using websnapr thumbnail service
      var content = '<img src="http://images.websnapr.com/?url=';
      content += $(this).attr('href');
      content += '" alt="Loading thumbnail..." height="152" width="202" />';
      
      // Setup the tooltip with the content
      $(this).qtip(
      {
         content: content,
         position: {
            corner: {
               tooltip: 'bottomMiddle',
               target: 'topMiddle'
            }
         },
         style: {
            tip: true, // Give it a speech bubble tip with automatic corner detection
            name: 'cream'
         }
      });
   });
});

/*
## TODOS AS POSIÇÕES
###############################
###############################
*/
// Define corners and opposites arrays
var corners = [
   'bottomLeft', 'bottomRight', 'bottomMiddle',
   'topRight', 'topLeft', 'topMiddle',
   'leftMiddle', 'leftTop', 'leftBottom',
   'rightMiddle', 'rightBottom', 'rightTop'
];
var opposites = [
   'topRight', 'topLeft', 'topMiddle',
   'bottomLeft', 'bottomRight', 'bottomMiddle',
   'rightMiddle', 'rightBottom', 'rightTop',
   'leftMiddle', 'leftTop', 'leftBottom'
];
var i = 0;

// Create the tooltips only on document load
$(document).ready(function() 
{
   $('#teste')
      .click(function()
      {
         // If counter reaches maximum, reset
         if(i === corners.length) i = 0;
         
         // Destroy currrent tooltip if present
         if($(this).data("qtip")) $(this).qtip("destroy");
         
         $(this).html(opposites[i]) // Set the links HTML to the current opposite corner
            .qtip({
               content: corners[i], // Set the tooltip content to the current corner
               position: {
                  corner: {
                     tooltip: corners[i], // Use the corner...
                     target: opposites[i] // ...and opposite corner
                  }
               },
               show: {
                  when: false, // Don't specify a show event
                  ready: true // Show the tooltip when ready
               },
               hide: false, // Don't specify a hide event
               style: {
                  border: {
                     width: 5,
                     radius: 10
                  },
                  padding: 10, 
                  textAlign: 'center',
                  tip: true, // Give it a speech bubble tip with automatic corner detection
                  name: 'cream' // Style it according to the preset 'cream' style
               }
            });
         
         i++; // Increase the counter
      });
});


/*
## TOOLTIPS COMUN
###############################
###############
