﻿var gBaseUrlStatistic = '/';

function clickPhone(fId) {
   setTimeout(function(){ tStatisticFix("phone", fId); }, 100);
}

function clickSms(fId) {
   setTimeout(function(){ tStatisticFix("sms", fId); }, 100);
}

function tStatisticFix(fType, fId) {
    if(!fType || !fId)
       return;
    var url = gBaseUrlStatistic + 'handlers/' + fType + 'statistic.ashx?id=' + fId;
    jQuery.get(url);
}

function clickEmailTell(fText, fSubject, fAddLink, fId) {
   var tLink = fAddLink === true ? window.location.href : "";
   var tText = fText + " " + tLink;
   if(fId && parseInt(fId) > 0)
      setTimeout(function(){ tStatisticFix("email", fId); }, 100);
   else {
       if(fSubject)
           window.location = "mailto:?subject=" + fSubject + "&body=" + tText;
       else
           window.location = "mailto:?body=" + tText;
   }
}

