var xmlHttp

function searchCount(region, country, style, activitylevel, startdate, enddate) {
				document.getElementById("search_count").innerHTML = '<div class="search_count_result" style="padding-top:2px;"><img src="http://www.eldertreks.com/images/navigation/loading.gif" height="16px"></div>' 
				xmlHttp=GetXmlHttpObject()
				if (xmlHttp==null) {
					alert ("Browser does not support HTTP Request")
					return
				}
				/*
				if(startdate != "" && startdate != "Starting After") {
					startdate = startdate.replace(/-/g, "");
				}else{
					startdate = '';
				}
				if(enddate != "" && enddate != "Ending Before") {
					enddate = enddate.replace(/-/g,"");
				}else{
					enddate = '';
				}
				*/
				var url="http://www.eldertreks.com/searchCount.php"
				url=url+"?region="+region
				url=url+"&countries="+country
				url=url+"&style="+style
				url=url+"&activitylevel="+activitylevel
				/*
				if(startdate != '') {
					url=url+"&startdate="+startdate
				}
				if(enddate != '') {
					url=url+"&enddate="+enddate
				}
				*/
				// alert(url);
				xmlHttp.onreadystatechange=stateChange 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)
}

function stateChange() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 		document.getElementById("search_count").innerHTML= '<div class="search_count_result">'+xmlHttp.responseText+'</div>' 
 	} 
}

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;
}