// Fade
//window.onload = function() {
//$('#wrapper').hide().fadeIn('slow');
//};

// Image swap
function initRollOverImages() {
  var image_cache = new Object();
  $("img.rollover").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_ovr = this.src.substr(0, dot) + '-ovr' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_ovr;
    $(this).hover(
      function() { this.src = imgsrc_ovr; },
      function() { this.src = imgsrc; });
  });
}
$(document).ready(initRollOverImages);

// Link - blank
$(function(){
  $(".blank").click(function(){
    this.target = "_blank";
  });
});

// Tooltip
$(document).ready(function()
{
   $('a[title]').qtip({
      position: {
      	adjust: { screen: true },
         corner: {
            target: 'rightMiddle',
            tooltip: 'topLeft'
         }
      },
      style: { 
      width: {
            max: 210,
            min: 0
         },
      padding: 0,
      background: '#000000',
      color: 'white',
      textAlign: 'center',
      border: {
         width: 1,
         radius: 5,
         color: '#000000'
      },
      tip: 'leftTop',
      name: 'dark' // Inherit the rest of the attributes from the preset dark style
   }

   });
});
