$.fn.pause = function(_duration, _callback) {
  $(this).animate({ dummy: 1 }, _duration, _callback);
  return this;
};

$(document).ready(function () {
  $('#sidebar').pause(1000, function () {
    $(this).css({ top: '-100px' })
           .animate({ top: '00' }, {queue: false, duration: 600, easing: 'easeOutCubic'})
           .animate({ opacity: 'show' }, {queue: false, duration: 1200})
  })

  $('a[rel=external]').each(function () {this.target = '_blank'});
});

function initHPElements(access_token)
{
  $('#hp-gallery').fbGallery({ albumID: '166956330019824' });
  $('#hp-feed').fbFeed({ feedID: '134124903302967', 
                         accessToken: access_token,
                         filterID: '134124903302967', 
                         limit: 10, 
                         limitUnit: 'posts',
                         format: function(fb) { 
                           return '<strong>Posted ' + fb.created_time.format('mmmm d, yyyy') + '</strong>' +
                                  '<small>' + linkify(fb.message) + '</small>' 
                         }

                         }, function() { 
    setTimeout('rotateFacebook()', 8000);
  });
}

