var id='8ace6fi8';
var purl='http://75.101.130.105/ping/';

lejsr.scnt = 1;

function lejsr(url,nc) {
    this.fullUrl = url; 
    this.lencie = '&nc=' + (new Date()).getTime();
    this.headLoc = document.getElementsByTagName("head").item(0);
    this.scriptId = 'JscriptId' + lejsr.scnt++;

    this.leso = document.createElement("script");
    this.leso.setAttribute("type", "text/javascript");
    this.leso.setAttribute("charset", "utf-8");
    this.leso.setAttribute("src", this.fullUrl + (nc==null?this.lencie:''));
    this.leso.setAttribute("id", this.scriptId);

    this.headLoc.appendChild(this.leso);
}


var timeOut;
var interval = 10;


var rs=1;
var ra=1;
var pObj = 0;

var up = function() 
{
	if (interval == 0) {return true;}
	if (pObj != 0) {pObj.leso.parentNode.removeChild(pObj.leso);}
	rs++;
	pObj = new lejsr(purl+id+'/'+reqindex+'/'+rs+'/5'); 
	timeOut=setTimeout(up, 1000 * interval);
};

var Cookie = {
  set: function(n, v, dte) {
    var e = '';
    if (dte != undefined) {
      var d = new Date();
      d.setTime(d.getTime() + (86400000 * parseFloat(dte)));
      e = '; expires=' + d.toGMTString();
    }
    return (document.cookie = escape(n) + '=' + escape(v || '') + e + '; path=/');
  },
  get: function(n) {
    var cookie = document.cookie.match(new RegExp('(^|;)\\s*' + escape(n) + '=([^;\\s]*)'));
    return (cookie ? unescape(cookie[2]) : null);
  }
};

var reqindex = Cookie.get('idx') || -1;
if ((tid = Cookie.get('tid')) == null){
	var tid = '';
	for (var a=0;a<16;a++){tid = tid + String.fromCharCode(Math.round(25*Math.random())+65);}
	Cookie.set('tid', tid, 730);
}

if ((tid = Cookie.get('tid')) == null){
	leio = new lejsr('http://'+id+'.appmetrx.com/f/'+id+'.js',1);
} else {
	timeOut=setTimeout(up, 1000 * interval);
	var tz = ((new Date()).getTimezoneOffset()/60)+12;

	var req  = purl+id+'/'+reqindex+'/'+rs+'/5/'+tid+'/'+tz+'?m='+escape(location.href)+'&p='+escape(document.referrer); 

	leio = new lejsr(req); 
}


