function captureStats(url) 
{

    http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
    	try {
        	http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    else
    {
    	http_request.open('GET', url, true);
	    http_request.send(null);
    }
}


function captureData(websiteURL, source, lid, searchID,domain)
{
	//var newURL = "http://"+domain+"/common/include/statsCapture.php?searchID="+searchID+"&source="+source+"&p_EID=&pURL="+websiteURL+"&lid="+lid+"&" + Math.random();
	var newURL = "/common/include/statsCapture.php?searchID="+searchID+"&source="+source+"&p_EID=&pURL="+websiteURL+"&lid="+lid+"&" + Math.random();
	captureStats(newURL);
}

function captureDataLegalTopic(aopId, aopText, rowCount)
{
	//var newURL = "http://"+domain+"/common/include/statsCapture.php?searchID="+searchID+"&source="+source+"&p_EID=&pURL="+websiteURL+"&lid="+lid+"&" + Math.random();
	var newURL = "/common/include/statsCaptureTopicArea.php?aop_id="+aopId+"&aop_text="+aopText+"&n="+rowCount+"&" + Math.random();
	//alert(newURL);
	captureStats(newURL);
}

