var imageSwapCountdown = 0;

function $(id)
{ 
    return document.getElementById(id); 
} 

function $showhide(id)
{ 
    $(id).style.display = ($(id).style.display == 'none') ? '' : 'none'; 
} 
    
function init()
{
    countdownToNextSwapImage();
}

function swapImages()
{
    //alert('timed');
    //$showhide('feat-delivery');
    $showhide('feat-visit');
    //$showhide('feat-nutrition');
    $showhide('feat-bmi');
    
    countdownToNextSwapImage();
}

function countdownToNextSwapImage()
{
    if(imageSwapCountdown > 0)
    {
        clearTimeout(imageSwapCountdown);
    }
    imageSwapCountdown = setTimeout('swapImages()', 5000);
    
}