/**
 * Productions Rotator
 * @author Guillaume VanderEst <gvanderest@netshiftmedia.com>
 */

var currentProduction = 1;
var totalProductions = 4;

function showNextProduction()
{
    $('.productionRotator li:nth-child(' + currentProduction + ')').fadeOut(function(){
    
        nextProduction = ((currentProduction + 1) > totalProductions) ? 1 : (currentProduction + 1);
        $('.productionRotator li:nth-child(' + nextProduction + ')').fadeIn();
        currentProduction = nextProduction;
    
    });
}
 
$(document).ready(function(){

    $('.productionRotator li').hide();
    $('.productionRotator li:nth-child(' + currentProduction + ')').fadeIn();
    
    setInterval('showNextProduction()', 4000);

});
