//get values
user_agent = escape(navigator.userAgent);
referrer = escape(document.referrer);
visited = escape(document.URL);

var url = "http://www.netlisbon.com/wp-content/plugins/simple_stats/counter_end.php";
var params = "user_agent=" + user_agent + "&referrer=" + referrer + "&visited=" + visited + "&test=test";

function getHTTPObject() {
	var http = false;
	//Use IE's ActiveX items to load the file.
	if(typeof ActiveXObject != 'undefined') {
		try {http = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e) {
			try {http = new ActiveXObject("Microsoft.XMLHTTP");}
			catch (E) {http = false;}
		}
	//If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document.
	} else if (XMLHttpRequest) {
		try {http = new XMLHttpRequest();}
		catch (e) {http = false;}
	}
	return http;
}
var http = getHTTPObject();

function handler() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {

	}
}

function getMethod() {
	http.open("GET", url+"?"+params, true);
	http.onreadystatechange = handler;
	http.send(null);
}

function postMethod() {
	http.open("POST", url, true);
	
	//Send the proper header infomation along with the request
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");

	http.onreadystatechange = handler;
	http.send(params);
}

window.onload=function(){
 postMethod();
}