function slideSwitch() {
  var $active = $('.slideshow img.active');
  if ( $active.length == 0 ) $active = $('.slideshow img:last');
  var $next =  $active.next().length ? $active.next()
    : $('.slideshow img:first');
      $active.addClass('last-active')
             .animate({opacity: 0}, 2000);
      $next.css({opacity: 0})
           .addClass('active')
           .animate({opacity: 1}, 2000, function() {
              $active.removeClass('active last-active');
           });
}
$(function() {
  setInterval( "slideSwitch()", 4000 );
});

$(document).ready(function(){
  $(".readmore-left-link").colorbox({width:"50%", inline:true, href:"#readmore-left", fixed:true, speed:1000, initialWidth:50, initialHeight:30, transition:"fade", fastIframe:true});
  $(".readmore-right-link").colorbox({width:"50%", inline:true, href:"#readmore-right", fixed:true, speed:1000, initialWidth:50, initialHeight:30, transition:"fade", fastIframe:true});
  
  $('#dock').Fisheye(
				{
					maxWidth: 20,
					items: 'span',
					container: '.dock-container',
					itemWidth: 200,
					proximity: 50,
					alignment: 'left',
					valign: 'bottom',
					halign: 'center'
				}
			)
  
  $('.dock-item img').hover(function() {
      $(this).stop().animate({"opacity": "1"},  "medium");
    },
    function() {
      $(this).stop().animate({"opacity": "0"},  "slow");
    });
});
