      function swapImages(){
        var $active = $('#mainImage .active');
        var $next = ($('#mainImage .active').next().length > 0) 
          ? $('#mainImage .active').next() : $('#mainImage img:first');
        $active.fadeOut(1000,function(){
        $active.removeClass('active');
        });
        $next.fadeIn(1000).addClass('active');
      }
      
     $(document).ready(function(){
       setInterval('swapImages()', 5000);
       $('div.box').find('.boxtext').hide();
       $("div.box").hover(function(event){
         $(this).find('.boxtext').fadeTo(500,1);
         $(this).find('.boximg').fadeTo(500,0.1);
       },function(event){
         $(this).find('.boxtext').fadeTo(500,0);
         $(this).find('.boximg').fadeTo(500,1);
       });
       $("div.box").click(function(event){
        window.location.href = $(event.target).closest('div[class~=box ]').find('a').attr('href');
       });

     });

