// 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() 
{
	$('#bio_menu').qtip({
		content: $('#bio').html(),
		show: 'mouseover',
		hide: 'mouseout',
        style: {
            border: {
               width: 5,
               radius: 10
            },
            padding: 10, 
            tip: true, // Give it a speech bubble tip with automatic corner detection
            background: '#fff',
            color: 'black',
            left: '200px'
         },
         position: {
        	 corner: {
        	 	tooltip: 'bottomLeft'
        	 }
         },
         api: {
             beforeShow: function(){
                $('.qtip').each(function(){
                	this.style.marginTop = "330px";
                	this.style.marginLeft = "0px";
                });
             }
          }
	});
	
	$('#softies_menu').qtip({
		content: $('#softies').html(),
		show: 'mouseover',
		hide: 'mouseout',
        style: {
            border: {
               width: 5,
               radius: 10
            },
            padding: 10, 
            tip: true, // Give it a speech bubble tip with automatic corner detection
            background: '#fff',
            color: 'black',
            left: '200px'
         },
         position: {
        	 corner: {
        	 	tooltip: 'rightBottom'
        	 }
         },
         api: {
             beforeShow: function(){
                $('.qtip').each(function(){
                	this.style.marginTop = "250px";
                	this.style.marginLeft = "80px";
                });
             }
          }
	});
	
	
	$('#art_menu').qtip({
		content: $('#art').html(),
		show: 'mouseover',
		hide: 'mouseout',
        style: {
            border: {
               width: 5,
               radius: 10
            },
            padding: 10, 
            tip: true, // Give it a speech bubble tip with automatic corner detection
            background: '#fff',
            color: 'black',
            left: '200px'
         },
         position: {
        	 corner: {
        	 	tooltip: 'bottomLeft'
        	 }
         },
         api: {
             beforeShow: function(){
                $('.qtip').each(function(){
                	this.style.marginTop = "350px";
                	this.style.marginLeft = "0px";
                });
             }
          }
	});
	
	
	$('#shop_menu').qtip({
		content: $('#shop').html(),
		show: 'mouseover',
		hide: 'mouseout',
        style: {
            border: {
               width: 5,
               radius: 10
            },
            padding: 10, 
            tip: true, // Give it a speech bubble tip with automatic corner detection
            background: '#fff',
            color: 'black',
            left: '200px'
         },
         position: {
        	 corner: {
        	 	tooltip: 'bottomLeft'
        	 }
         },
         api: {
             beforeShow: function(){
                $('.qtip').each(function(){
                	this.style.marginTop = "400px";
                	this.style.marginLeft = "-300px";
                });
             }
          }
	});
	
	$('#contact_menu').qtip({
		content: $('#contact').html(),
		show: 'mouseover',
		hide: 'mouseout',
        style: {
            border: {
               width: 5,
               radius: 10
            },
            padding: 10, 
            tip: true, // Give it a speech bubble tip with automatic corner detection
            background: '#fff',
            color: 'black',
            left: '200px'
         },
         position: {
        	 corner: {
        	 	tooltip: 'bottomMiddle'
        	 }
         },
         api: {
             beforeShow: function(){
                $('.qtip').each(function(){
                	this.style.marginTop = "380px";
                	this.style.marginLeft = "-310px";
                });
             }
          }
	});
	
/**	
   $('#content a')
      .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
      });**/
});