function createRequestObject() {
	var ua;

	if(window.XMLHttpRequest) {
		try {
			ua = new XMLHttpRequest();
		} catch(e) {
			ua = false;
		}
	} else if(window.ActiveXObject) {
		try {
			ua = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			ua = false;
		}
	}
	return ua;

}

function updateStateCount(state,timestamp) {
	var xhReq = createRequestObject();
	xhReq.open("get", "/includes/counter.php?type=1&state="+state+"&t="+timestamp, true);
	xhReq.send(null);
	xhReq = "";
}

function updateCityCount(city, state,timestamp) {	
	var xhReq = createRequestObject();
	xhReq.open("get", "/includes/counter.php?type=2&state="+state+"&city="+city+"&t="+timestamp, true);
	xhReq.send(null);
	xhReq = "";
}

function updateAgentCount(agent,timestamp) {
	var xhReq = createRequestObject();
	xhReq.open("get", "/includes/counter.php?type=3&agent="+agent+"&t="+timestamp, true);
	xhReq.send(null);
	xhReq = "";
}

function updateAdCount(agent,timestamp,zip) {
	var xhReq = createRequestObject();
	xhReq.open("get", "/includes/counter.php?type=4&agent="+agent+"&zip="+zip+"&t="+timestamp, true);
	xhReq.send(null);
	xhReq = "";
}