function addCommentReply(id , element)
{
    if($(element).find('[name=text]').val().length < 3)
    {
        alert('Введите текст комментария')
    }
    else
    {
        $.post('/engine/ajax/addreply.php?action=add', $(element).serialize(),function(data)
        {
           $('#addCommentreply_' + id).hide();
           comments_reply_update(id);
        }, 'html');            
    }
        
    return false;   
}

function deleteCommentReply(id,comment_id)
{
    $.post('/engine/ajax/addreply.php?action=delete',{'id': id},function(data)
    {
       $('#addCommentreply_' + id).hide();
       comments_reply_update(comment_id);
    }, 'html');            
}

function comments_reply_update(id)
{
    $.post('/engine/ajax/addreply.php?action=update' , {'parent_id': id},function(data)
    {
        $('#replyComments_' + id).html(data);    
    });
    
}

function addCommentReplyForm(id)
{
    $('#addCommentreply_' + id).toggle();
}

function notice()
{
    updateNotice();    
}

function updateNotice()
{
    $('#notice').load('/engine/ajax/notice.php');
    setTimeout('updateNotice()', 20000);
}
