<script type="text/javascript">
$(document).ready(function(){
$('a').on('click', function(){
var url = $(this).attr('href'), goal='';
switch(url) {
case '#popup:calback_top_menu':
if(window.mainMetrika > '' && window[window.mainMetrika]) {
var virtPage = window.location.pathname+'/popup/'+url.substring(7);
var virtTitle = $(this).text();
window[window.mainMetrika].hit(virtPage, {title: virtTitle,referer: window.location.href});
}
break;
case '#rec123456':
goal = 'click_rec123456';
break;
case 'https://yandex.ru':
goal = 'buybuy';
break;
case 'example.com':
goal = 'coldclient';
break;
default :
break;
}
if(goal>'' && window.mainMetrika > '' && window[window.mainMetrika]) {
window[window.mainMetrika].reachGoal(goal);
if (url.substr(0,4) == 'http') {
setTimeout(function(){
window.location.href = url;
},
200
);
return false;
}
}
return true;
});
});
</script>