function getParams(target, theState, dry, fire, iliq, muni, country) {
	if (country == undefined) {
		country = 'usa';
	}
	
	if ((dry == '') && (fire == '') && (iliq == '') && (muni == '')) {
		alert("Please select at least one market.");
		return;
	}

	if (theState == '') {
		alert("Please select a state.");
		return;
	}
	
	var theString = "q=" + theState + "&db=" + dry + "&fp=" + fire + "&il=" + iliq + "&mw=" + muni + "&ctry=" + country;
	
	showResult(target, theString);
}

var xmlHttp;

function showResult(target, str) {
	if (str.length == 0) { 
		document.getElementById(target).innerHTML = "";
		return;
	}

	xmlHttp = GetXmlHttpObject();

	if (xmlHttp == null) {
		alert("Browser does not support HTTP Request");
		return;
	} 

	var url = "inc/search.php?" + str + "&c=" + target + "&sid=" + Math.random();
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() {
		stateChanged(target);
	}
	xmlHttp.send(null);
} 

function stateChanged(target) {
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") { 
		document.getElementById(target).innerHTML = xmlHttp.responseText;
	} 
}

function GetXmlHttpObject()	{
	var xmlHttp = null;

	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
 		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}