$(document).ready(function() {
   
   setupClusterRollovers();
   
});

function setupClusterRollovers() {

    // hide all content wells
    $('div.home-clusters-spiff-content').hide();
    $('div.home-clusters-spiff-content:first').fadeIn();
    $('ul#clusters-list a').mouseover(function() {
        
        // old ajax style load.
        // replace content with loader image
        /*$('div.home-clusters-spiff-content img').hide();
        $('div.home-clusters-spiff-content h3').hide();
        $('div.home-clusters-spiff-content p').html('<img src="/elements/img/ajax-loader.gif" alt="loading" />');
        */
        // which link are we hovering over?
        $('div.home-clusters-spiff-content').hide();
        var slug = $(this).attr('rel');
        $('div#' + slug).fadeIn(0);
       
        /* 
        // get the data for this link
        $.ajax({
            url: "/temp/cluster-spiff-test/" + slug,
            dataType: 'json',
            success: function(data) {
                
                // populate the SPIFF and animate it
                $('div.home-clusters-spiff-content img').attr('src', data.img).fadeIn('slow');
                $('div.home-clusters-spiff-content h3').html(data.title).fadeIn('slow');
                $('div.home-clusters-spiff-content p').html(data.body).fadeIn('slow');
                
            }
        });
        */
        
    });
    
}
