
function showRanking( nhvID , slug) {
    enableLoader();
    $.post(
        '/team/showRanking/' + slug,
        { id: nhvID },
        function( data ) { replaceBlock( data ) }
    );
}

function showResults( nhvID , slug) {
    enableLoader();
    $.post(
        '/team/showResults/' + slug,
        { id: nhvID },
        function( data ) { replaceBlock( data ) }
    );
}

function showProgram( nhvID , slug) {
    enableLoader();
    $.post(
        '/team/showProgram/' + slug,
        { id: nhvID },
        function( data ) { replaceBlock( data ) }
    );
}


function replaceBlock( data ) {
    $("#dataBlock").html( data );
    disableLoader();
}

function enableLoader() {
    $("#pageBlock").animate( { opacity: 0.2 }, 400);
    $("#ajaxLoader").show();
}

function disableLoader() {
    $("#pageBlock").animate( { opacity: 1 }, 200);
    $("#ajaxLoader").hide();
}