$('.ag_phone_cont[data-id=2524]').css("display","inline-block");
$('.ag_phone_cont[data-id=2524] em').html('+7 (812) 425-XX-XX');
$('.back_call[data-id=2524]').data("b_id",180);
if (typeof(gaUserId) == 'undefined')
gaUserId = '';
$('.ag_phone_cont[data-id=2524] .ag_get_phone').bind('click',function(){
if ($('.ag_phone_cont[data-id=2524] .ag_get_phone').data('set')!=1) {
$.ajax({
type: "POST",
url: "https://agentguru.ru/api/v2/redirect",
data: JSON.stringify({ resource: { s_id: '', id: 2524, source: 1, uid: gaUserId } }),
success: function(phone) {
if (phone=='')
$('.ag_phone_cont[data-id=2524]').hide();
else {
$('.ag_phone_cont[data-id=2524]').addClass('ag_phone_set');
//$('.ag_phone_r[data-id=2524]').html(phone);
e = $('.ag_phone_r[data-id=2524]');
style = e.attr('style');
if (style==undefined)
style='';
style=style+';text-decoration:none !important;color:'+e.css("color")+' !important;font-size:'+e.css("font-size")+' !important;font-weight:'+e.css("font-weight")+' !important;';
e.replaceWith(''+phone+'');
}
$('.ag_phone_cont[data-id=2524] .ag_get_phone').data('set',1);
}
});
}
return false;
});