/* Scripts.js - Global
Name: 
URI: http://
Version: 1.0
Author: Studio Lift - kc
Author URI: http://studiolift.com/
*/

//Son Of Suckerfish (jQuery styleee) 
function sfHover(){
  $("#nav li").hover(function(){
    $(this).addClass("sfhover");
  },
  function(){
    $(this).removeClass("sfhover");
  })
}

//#nav li ul bg-color must match hover-color of first li 
function navULHover(){
  $('#nav li ul li:first-child').hover(function(){
    $('#nav li ul').css('background-color','rgb(116,131,142)');
  },
  function(){
    $('#nav li ul').css('background-color','rgb(93,108,119)');
  })
}

//external links in new window
function targetExternalLinks(){ 
  $('a[href^="http://"]').each(function(){
    if(this.href.indexOf(location.hostname) == -1){
      $(this).attr('target', '_blank');
    }
  })
}

/**
 * All done? Let's call it.
 */
$(document).ready(function(){
  sfHover();
  navULHover();
  targetExternalLinks();
  
  /* This is basic - uses default settings */
  $("a#single_image").fancybox();
  /* Using custom settings */
  $("a#inline").fancybox({
    'hideOnContentClick': true
  });
  $("a.group").fancybox({
    'speedIn'   : 600, 
    'speedOut'    : 200, 
    'overlayShow' : false
  });

});
