$(document).ready(function() {

  $('.post a').each(function(index, element){
    element = $(element);
    element.attr('target', '_blank');
  });

  // - Twitter Widget
  $('#twitterWidget').jTweetsAnywhere({
    username:'nearapogee',
  count: 1,
  showTweetFeed: {
    showSource: false,
  showGeoLocation: false,
  showProfileImages:false,
  showInReplyTo:false,
  includeRetweets: false,
  paging: { mode: 'prev-next' }
  },
  tweetFeedControlsPrevBtnDecorator: function(tweet, options){
    var btn='<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-prev"><a class="prevButton" href="#">Previous</a></span>'
    return btn;
  },
  tweetFeedControlsNextBtnDecorator: function(tweet, options){
    var btn='<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-next"><a class="nextButton" href="#">Next</a></span>'
    return btn;
  }, 
  tweetTimestampDecorator: function(tweet, options){
    return '';
  },
  loadingDecorator: function(options){
    return '<li class="jta-loading"></li>';
  }
  });

  // - Testimonials Rotator
  $('#testimonialsRotator').testimonials();

  // - Nivo Slider
  $('#slider').nivoSlider({
    effect:'boxRain',
    pauseTime:4000,
    controlNav:false,
    keyboardNav:false,
    boxCols:4,
    boxRows:4,
    animSpeed:3000, 
    afterLoad:function(){
      $('.nivoSlider').hide().fadeIn(500);
      $('.sliderContent li:first-child').animate({'opacity': '1'}, 500);
    }
  });

  // - Images Hover
  $('.columnContent').find('a').hover(
      function(){
        $(this).find('img').stop().animate({'opacity': '.5'}, 250);
        return false;
      },
      function(){
        $(this).find('img').stop().animate({'opacity': '1'}, 250);
        return false;
      }
      );

});

