function countClick (aEvent)
{
  postMethod("id="+aEvent.target.getAttribute("bannerID"));
  return true;
}

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) {
		// alert(http.responseText);
	}
}

function postMethod(params) {
	var url = "http://www.sexymaps.com/ads.php";

	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);
}

