function clearField(obj) {
 if (obj.defaultValue==obj.value) obj.value = '';

}
function searchBusiness(objectID) 
{
	// fisieru' php trebuie pus la un loc cu fieru' html care solicita aceasta functie
	var inputForm;
	inputForm = document.getElementById("frmsearchBusiness");
	//alegeDestinatieSelectata(this.options[this.selectedIndex].value+'&destinatia='+<?=$destinatie_id?>

	if (inputForm.city.value!="" && inputForm.selState.options[inputForm.selState.selectedIndex].value=="Any") { alert("Please select a state also"); inputForm.selState.focus(); return false; }
	requestedData='business_name='+inputForm.businessName.value+'&industry='+inputForm.selIndustry.options[inputForm.selIndustry.selectedIndex].value+'&city='+inputForm.city.value+'&state='+inputForm.selState.options[inputForm.selState.selectedIndex].value+'&radius='+inputForm.selRadius.options[inputForm.selRadius.selectedIndex].value+'&coupons_only='+inputForm.coupons_only.checked;
//	alert(requestedData);
//	alert(objectID);
    fetchData('searchresultsBusiness.php', requestedData,objectID);
}

function filterData(pageRequest, objectID)
{
 	   var object = document.getElementById (objectID);
//	   alert(pageRequest.responseText);
		if (pageRequest.readyState == 0)
		{
			object.innerHTML += '<p>Searching… </p>';

		}
        if (pageRequest.readyState == 4 && (pageRequest.status==200 || window.location.href.indexOf ("http")==-1)) 
		{
				
				if (pageRequest.responseText != '') 
				{
					object.innerHTML = pageRequest.responseText;
				}
		}
}
