


if (typeof(_smpl) == 'undefined') {
  function _smpl() {

    if (typeof(_smpl_) == 'undefined') {
      _smpl_ = {mult : 10, sample : true};

      var cookies = document.cookie.split(';');
      for (var i=0; i < cookies.length; i++) {
        var cookie = cookies[i];
        while (cookie.charAt(0)==' ') cookie = cookie.substring(1);
        if (cookie.indexOf('smplu=') == 0) {
          _smpl_.user = cookie.substring(6);
        }
        if (cookie.indexOf('smplm2=') == 0) {
          _smpl_.mult = parseInt(cookie.substring(7), 10);
        }
      }

      var date;
      if (_smpl_.user == undefined) {
        _smpl_.user = new Date().getTime() + '' + Math.floor(Math.random() * 1000000000);
        date = new Date(); date.setTime(date.getTime()+1E12);
        document.cookie = 'smplu='+_smpl_.user+'; expires='+date.toGMTString()+'; path=/';
      }
      if (_smpl_.mult == 0) _smpl_.mult = 1;
      date = new Date(); date.setTime(date.getTime()+2400000);
      document.cookie = 'smplm2='+_smpl_.mult+'; expires='+date.toGMTString()+'; path=/';

      var hashCode = 0;
      for (var pos = 0; pos < _smpl_.user.length; pos++) {
        hashCode = hashCode + _smpl_.user.charCodeAt(pos);
        hashCode = (hashCode * 15237) % 2147483647;
        hashCode = (hashCode * 52383) % 2147483647;
      }
      _smpl_.track = hashCode <= Math.floor(2147483647/_smpl_.mult);
    }
    return _smpl_;

  }
}
if (typeof(_smpl_uri) == 'undefined') {
  function _smpl_uri(uriSuffix, queryPart) {
    var smpl = _smpl();
    if (smpl.track) {
      if (smpl.sample) {
        return '/analytics/tracker'+uriSuffix+queryPart+'&s='+smpl.user+'&l='+smpl.mult;
      } else {
        return '/analytics/tracker'+uriSuffix+queryPart;
      }
    } else {
      return '/analytics/tracker'+uriSuffix;
    }
  }
}
if (typeof(_clk) == 'undefined') {
  function _clk(context) {
    var xmlHttp = false;
    if (typeof(XMLHttpRequest) != 'undefined') {
      xmlHttp = new XMLHttpRequest();
    } else {
      try {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch(ignored) {
        try {
          xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(ignored) {
        }
      }
    }
    if (xmlHttp) {
      xmlHttp.open('GET', _smpl_uri('.xml', '?m=h&c='+escape(context)), true);
      xmlHttp.send(null);
    } else {
      new Image().src=_smpl_uri('.gif', '?m=h&c='+escape(context)+'&p='+(new Date().getTime().toString()));
    }
    return true;
  }
}
