Ваша корзина пуста!
Подождите пожалуйста!
');
urll = this.href+'#tab-review';
location = urll;
$('.attention').remove();
return false;
});
}
function remove_success()
{
$('.success, .warning').fadeIn().animate({
opacity: 0.0
}, 5000, function() {
$('.success, .warning').remove();
});
}
// from config и get
function comment_write(event)
{
$('.success, .warning').remove();
if (typeof(event.data.sorting) == "undefined")
{
sorting = 'none';
} else {
sorting = event.data.sorting;
}
if (typeof(event.data.page) == "undefined")
{
page = '1';
} else {
page = event.data.page;
}
if (typeof(this.id) == "undefined") {
myid = '0';
} else {
myid = this.id.replace('button-comment-','');
}
$.ajax(
{
type: 'POST',
url: 'index.php?route=record/record/write&record_id=84&parent=' + myid + '&page=' + page,
dataType: 'json',
data: 'name=' + encodeURIComponent($('#comment_work_'+myid).find('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('#comment_work_'+myid).find('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('#comment_work_'+myid).find('input[name=\'rating\']:checked').val() ? $('#comment_work_'+myid).find('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('#comment_work_'+myid).find('input[name=\'captcha\']').val()),
beforeSend: function()
{
$('.success, .warning').remove();
$('.button-comment').attr('disabled', true);
$('#comment-title #comment').after('
Подождите пожалуйста!
');
},
success: function(data)
{
$('.button-comment').attr('disabled', false);
if (data.error)
{
if ( myid == '0') $('#comment-title').after('' + data.error + '
');
else
$('#comment_work_'+ myid).prepend('' + data.error + '
');
}
if (data.success)
{
$.when($('#comment').comments(sorting, page )).done(function(){
if ( myid == '0')
{
$('#comment-title').after('' + data.success + '
');
}
else
{
$('#comment_work_' + myid).append(''+ data.success +'
');
}
remove_success();
});
$('.comment_count').html(data.comment_count);
$('.wysibb-text-editor').html('');
$('input[name=\'name\']').val(data.login);
$('textarea[name=\'text\']').val('');
$('input[name=\'rating\']:checked').attr('checked', '');
$('input[name=\'captcha\']').val('');
}
}
});
}
$(document).ready(function(){
$('.button-comment').unbind();
$('.button-comment').bind('click',{ }, comment_write);
$('#comment_id_reply_0').click();
});