var _epf = new Object(
{
    _reqs: [],
    u:function() {
        var c = '0123456789abcdef'.split('');
        var u = [], r = Math.random;
        for (var k = 0; k < 8; k++) {
            u[k] = c[0 | r()*16];
        }
        return u.join('');
    },
    cc:function(k,v,m) {
        var e = "";
        if (m) {
            var d = new Date();
            d.setTime(d.getTime()+(m*60*1000));
            e = "; expires="+d.toGMTString();
        }
        document.cookie = k+"="+v+e+"; path=/";
    },
    rc:function(k) {
        var n = k + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(n) == 0) return c.substring(n.length,c.length);
        }
        return null;
    },
    sr: function(cid,url) {
        var d = document;
        var el = d.createElement('script');
        var els = d.createAttribute("src");
        els.nodeValue = url;
        el.setAttributeNode(els);
        var eli = d.createAttribute("id");
        eli.nodeValue = cid;
        el.setAttributeNode(eli);
        var elid = d.createAttribute('type');
        elid.nodeValue = 'text/javascript';
        el.setAttributeNode(elid);

        _epf._reqs[cid] = '';
        d.getElementsByTagName('head')[0].appendChild(el);

    },
    cb: function(cid) {
        _epf.cc('_epf',_epf._reqs[cid],30);
        _epf.cr(cid);
    },
    cr: function(cid) {
        _epf._reqs[cid] = 'undefined';
        if (!(document.all && !window.opera && !window.XMLHttpRequest)) {
            document.getElementsByTagName('head')[0].removeChild(document.getElementById(cid));
        }
    },
    pp: function(s,o) {
    	if (!o) return "";
    	if (s[0] == '?') s = s.substring(1);
    	var x = s.split("&");
    	var q = "";
    	for (var i=0; i < x.length; i++) {
    		var y = x[i].split("=");
    		for (var j=0; j < o.length; j++) {
    			if (o[j] == y[0]) {
    				if (q.length == 0) {
    					q = "?"+x[i];
    				} else {
    					q = q+"&"+x[i];
    				}
    			}
    		}
    	}
    	return q;
    },
    t:function(t,c,dm, o, hr, tl) {
        var d = document;
        var l = d.location;
        var e = encodeURIComponent;
        var z = _epf.u();
        var s = _epf.rc('_epf');
        _epf.sr(z, l.protocol + "//trk.enecto.com/trk/3?z=" + z + "&c=" + c + "&m=" + l.protocol + "&s=" + s + "&i=" + t + "&y=" + new Date().getTime() + "&e=" + (d.characterSet ? d.characterSet : (d.charset ? d.charset : "")) + "&d=" + e(dm) + "&p=" + e(hr ? hr : l.pathname) + "&q=" + e(_epf.pp(l.search,o.i)) + "&t=" + e(tl ? tl : d.title) + "&r=" + e(d.referrer) + "&a=" + e(navigator.userAgent));
    }
});
_epf.e = function(i, d) {
    var a = this;
    a.c = i;
    a.d = (d ? d : document.location.host);
    a.o = {};
    
    a.pageview = function(href, title) {
        _epf.t('pv',this.c, this.d, this.o, href, title);
        return true;
    };

    a.click = function(e, href, title) {
        _epf.t('c',this.c, this.d, this.o, (href ? href : e.pathname), (title ? title : e.title));
        setTimeout('document.location = "' + e.href + '"', 100);
        return false;
    };

    a.includeParameters = function(p) {
		this.o.i = p;
	};
    
    return this;
};

_epf.get = function(i,d) {
    return new _epf.e(i,d);
};



