function displayTopData(dataType) {
	var params;

	if (dataType == "agentsCity") {
		if ($("#popularAgentsCity").html() == "") {

			params = "type=agentsCity&city=" + $("#cid").val();
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularAgentsCity";
		hideAllPopData();
	}
	if (dataType == "agentsProv") {
		if ($("#popularAgentsProv").html() == "") {

			params = "type=agentsProv&prov=" + $("#currentProv").val();
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularAgentsProv";
		hideAllPopData();
	}
	if (dataType == "agentsAll") {
		if ($("#popularAgentsAll").html() == "") {

			params = "type=agentsAll";
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularAgentsAll";
		hideAllPopData();
	}
	if (dataType == "officesProv") {
		if ($("#popularOfficesProv").html() == "") {

			params = "type=officesProv&prov=" + $("#currentProv").val();
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularOfficesProv";
		hideAllPopData();
	}
	if (dataType == "officesAll") {
		if ($("#popularOfficesAll").html() == "") {

			params = "type=officesAll";
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularOfficesAll";
		hideAllPopData();
	}
	if (dataType == "citiesProv") {
		if ($("#popularCitiesProv").html() == "") {

			params = "type=citiesProv&prov=" + $("#currentProv").val();
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularCitiesProv";
		hideAllPopData();
	}
	if (dataType == "citiesAll") {
		if ($("#popularCitiesAll").html() == "") {

			params = "type=citiesAll";
			gaAjax = new HZAjax("/phpHelpers/googleAnalytics/getTopInfoAjax.php?"+params, gaResponse);
			gaAjax.send();
		}
		currentType = "popularCitiesAll";
		hideAllPopData();
	}
	$("#" + currentType).show();
}

function gaResponse() {
	if (gaAjax.xmlhttp.readyState == 4) {
		$("#" + currentType)
			.html(gaAjax.xmlhttp.responseText);
	}
}

function hideAllPopData() {
	$("#popularAgentsAll").hide();
	$("#popularOfficesProv").hide();
	$("#popularAgentsCity").hide();
	$("#popularOfficesAll").hide();
	$("#popularCitiesProv").hide();
	$("#popularAgentsProv").hide();
	$("#popularCitiesAll").hide();
}

