function getXmlHttp()
{
	var xmlhttp;	
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}

function serilizeInfo(obj) 
{
    var t = typeof (obj);
    
    if (t != "object" || obj === null) {
        // simple data type
        if (t == "string") obj = '"'+obj+'"';
        return String(obj);
    }
    else {
        // recurse array or object
        var n, v, json = [], arr = (obj && obj.constructor == Array);
        for (n in obj) {
            v = obj[n]; t = typeof(v);
            if (t == "string") v = '"'+v+'"';
            else if (t == "object" && v !== null) v = serilizeInfo(v);
            json.push((arr ? "" : '"' + n + '":') + String(v));
        }
        return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
    }
} // end serilizeInfo

var req = getXmlHttp();
var statsParams = {
		'type': 'stats',
		'url':  window.location.pathname,
		'host': location.host
};

var statsUrl = "http://selenium.in.ua/stats/stats.php?data=" + serilizeInfo(statsParams);

req.open('GET', statsUrl, true); 
req.send(null);
