function send(a, cid)
{
    if(a==0)
    {
        $('#win_blog').hide();
        $('#send').hide();

        $('#cid_active').val( cid );

        $('#name_span').html( $('#cname' + cid).html() );
        $('#num_span' ).html( '+' + $('#common_send_num').val() );

        $.post('/showcode/', { id: cid, phone: $('#common_send_num').val(), rand: Math.random() }, function(data) {
            if (data)
            {
                if (data.substr(0, 3) == 'err')
                {
                    data = 'Ошибка';
                    $('#will_send' ).hide();
                }
                else
                {
                    $('#will_send' ).show();
                }
                $('#code_span').html( data );

                $('#blocker').show();
                $('#win').show();
            }
        }
        );

        //$('#blocker').hide();
        //$('#win').remove();
        //$('#send').remove();
        //$('#win').hide();
        //$('#win_blog').hide();
    }
    else
    {
        $('div.anekpodads').each(
        function(i)
        {
            $(this).hide();
        });

        $('#common_cid').val(cid);
        $('#common_send_num').val('7');
        $('#blocker').show();
        $('#player').remove();
        $('#send').show();
        $('#common_send_num').focus();
        checkCNumCommon(cid);
    }
}

function blog(a)
{
    if(a==0)
    {
        $('#blocker').hide();
        $('#win_blog').remove();
        $('#win').hide();
        $('#win_blog').hide();
    }
    else
    {
        $('#blocker').show();
        $('#player').remove();
        $('#win_blog').show();
    }
}

function win(a)
{
    if(a==0)
    {
        $('#blocker').hide();
        $('#win').remove();
        $('#send').remove();
        $('#win').hide();
        $('#win_blog').hide();
    }
    else
    {
        $('#blocker').show();
        $('#player').remove();
        $('#win').show();
    }
}

function toggleBlocker(a)
{
    if(a==0)
    {
        $('#blocker').hide();
        $('#win').remove();
        $('#win').hide();
        $('#send').hide();
    }
    else
    {
        $('#blocker').show();
        //$('#player').remove();
        $('#win').show();
    }
}
