function show_task_description(task)
{
    var task_id = task + '_description';
    var showed_div = $('#' + task_id);
    showed_div.fadeIn(400, function()
    {
        showed_div.css('display', 'block');
    });
}


function select_task(task)
{
    var task_intro_id = task + '_intro';
    var task_description_id = task + '_description';

    $('#task_list ul li').each(function(i)
    {
        var li = $(this);
        if(this.id == task_intro_id)
        {
            this.className = 'task_selected';
            $('#'+ this.id + ' .task_intro_picture').each(function(i)
            {
                $(this).css('display', 'none');
            });
            $('#'+ this.id + ' .task_selected_intro_picture').each(function(i)
            {
                $(this).css('display', 'block');
            });
            $('#'+ this.id + ' .task_selected_intro_picture img').each(function(i)
            {
                $(this).css('display', 'block');
            });
        }
        else
        {
            this.className = 'task';
            $('#'+ this.id + ' .task_intro_picture').each(function(i)
            {
                $(this).css('display', 'block');
            });
            $('#'+ this.id + ' .task_selected_intro_picture').each(function(i)
            {
                $(this).css('display', 'none');
            });
        }
    });

    $('#task_descriptions .task_description, #task_descriptions .task_description_selected').each(function(i)
    {
        var div = $(this);
        if(div.css('display') != 'none' && this.id != task_description_id)
        {
            div.fadeOut(100, function()
            {
                div.css('display', 'none');
                show_task_description(task);
            });
        }
    });
}