/*
 * Hide titles on portfolio images on hover
*/
 
 $.fn.hideTips = function(){
      return this.each(function(){
            // save element for referencing later
            var $elem = $(this)
            // save alt and title
            var savealt = $elem.attr('alt');
            var savetitle = $elem.attr('title');
            // on mouseover, remove attributes
            // on mouseout, set attributes
            $elem.hover(function(){
                  $elem.removeAttr('title').removeAttr('alt');
            },function(){
                  $elem.attr({title:savetitle,alt:savealt});
            });
      });
};

$(function(){
  $('a.thumb').hideTips();
});


/*
 * Download Resume Tooltip
*/


$(".downloadResume").qtip({
   content: '<a href="/files/KirstenLudwigResume.pdf" class="pdfLink">.PDF<span>30kb</span></a>',
   show: { effect: 'fade', delay: '0' },
   hide: { when: 'mouseout', fixed: true },
   position: {
      corner: {
         target: 'rightMiddle',
         tooltip: 'leftMiddle'
      }
   },
   style: { 
      width: 115,
      padding: 20,
      background: 'rgba(255%, 255%, 255%, 0.8)',
      color: '#dcf500',
      textAlign: 'center',
      border: {
         radius: 5,
         width: 3,
         color: '#dcf500'
      },
	tip: 'leftMiddle',
    name: 'light'
   }

});

/*
 * Download Portfolio Tooltip
*/

$(".downloadPortfolio").qtip({
   content: '<a href="/files/KirstenLudwigPortfolio.pdf" class="pdfLink">.PDF<span>7mb</span></a><a href="/files/KirstenLudwigPortfolio.mov" class="movLink">.MOV<span>155mb</span></a>',
   show: { effect: 'fade', delay: '0' },
   hide: { when: 'mouseout', fixed: true },
   position: {
      corner: {
         target: 'rightMiddle',
         tooltip: 'leftMiddle'
      }
   },
   style: { 
      width: 230,
      padding: 20,
      background: 'rgba(255%, 255%, 255%, 0.8)',
      color: '#dcf500',
      textAlign: 'center',
      border: {
         radius: 5,
         width: 3,
         color: '#dcf500'
      },
	tip: 'leftMiddle',
    name: 'light'
   }

});

/*
 * Download Portfolio/Resume Tooltip
*/

$("#nav .download").qtip({
   content: '<p>Download Portfolio</p><a href="/files/KirstenLudwigPortfolio.pdf" class="pdfLink">.PDF<span>7mb</span></a><a href="/files/KirstenLudwigPortfolio.mov" class="movLink">.MOV<span>155mb</span></a><p class="resume">Download Resume</p><a href="/files/KirstenLudwigResume.pdf" class="pdfLink">.PDF<span>30kb</span></a>',
   show: { effect: 'fade', delay: '0' },
   hide: { when: 'mouseout', fixed: true },
   position: {
      corner: {
         target: 'rightMiddle',
         tooltip: 'leftMiddle'
      }
   },
   style: { 
      width: 250,
      padding: 20,
      background: 'rgba(255%, 255%, 255%, 0.8)',
      color: '#dcf500',
      textAlign: 'left',
      border: {
         radius: 5,
         width: 3,
         color: '#dcf500'
      },
	tip: 'leftMiddle',
    name: 'light'
   }

});

/*
 * Download References Tooltip
*/

$(".downloadReferences").qtip({
   content: '<a href="/files/KirstenLudwigReferences.m4v" class="movLink">.M4V<span>47mb</span></a>',
   show: { effect: 'fade', delay: '0' },
   hide: { when: 'mouseout', fixed: true },
   position: {
      corner: {
         target: 'rightMiddle',
         tooltip: 'leftMiddle'
      }
   },
   style: { 
      width: 115,
      padding: 20,
      background: 'rgba(255%, 255%, 255%, 0.8)',
      color: '#dcf500',
      textAlign: 'center',
      border: {
         radius: 5,
         width: 3,
         color: '#dcf500'
      },
	tip: 'leftMiddle',
    name: 'light'
   }

});
