
/*******************
** Rollover
**
*/

jQuery(document).ready(function($) {
  var postfix = '_on';
  $('.rollover img, #header ul li a img, #socialMedia ul li a img').not('[src*="'+ postfix +'."]').each(function() {
    var img = $(this);
    var src = img.attr('src');
    var src_on = src.substr(0, src.lastIndexOf('.'))
               + postfix
               + src.substring(src.lastIndexOf('.'));
    $('<img>').attr('src', src_on);
    img.hover(
      function() {
        img.attr('src', src_on);
      },
      function() {
        img.attr('src', src);
      }
    );
  });
});

/*******************
** External Link Simple
**
*/

$(document).ready( function(){
  $(".blank").click( function(){
    window.open( this.href, '_blank' );
      return false;
  });
});

/*******************
** Easing Scroll Init
**
*/

$(function(){
  $("a[href*='#']").easingScroll({
    easing: "easeOutExpo",
    duration: 800
  });
});

/*******************
** Fadein Slideshow
** 
*/

$(function(){
    $('.fadein img:gt(0)').hide();
    setInterval(function(){
      $('.fadein :first-child').fadeOut(3000)
         .next('img').fadeIn(3000)
         .end().appendTo('.fadein');},
      6000);
});
