function checkSearchOptions() {
	
	var county = document.getElementById('county').value;
	var area = document.getElementById('area').value;
	var searchSQL = "";	
	var searchSQLParam = "";	
	
	if(county == 0 || area == 0) {
		//alert("Please select a food type, area or both in order to Search");
		$('#dialog').dialog({
					
					width: 500,
					modal: true,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						} 
						 
					}
				});

		return false;
	} else {		
		changeSearchText();
		
		
		$('#search-progress2').show();
		$('#searchbutton').attr("disabled", true);
		
		return true;
	}
}

function checkHomeSearchOptions() {
	
	var state = $('#state').val();
	
	
	
	if(state == 'area')
	{
	
	var county = document.getElementById('county').value;
	var area = document.getElementById('area').value;
	var searchSQL = "";	
	var searchSQLParam = "";	
	
	if(county == 0 || area == 0) {
		//alert("Please select a food type, area or both in order to Search");
		$('#dialog').dialog({
					
					width: 500,
					modal: true,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						} 
						 
					}
				});

		return false;
	} else {		
		changeSearchText('1');
		return true;
	}
	
	}
	else
	{
		var searchTA = $('#query').val();
		
		if(searchTA == null || searchTA == "")
		{
			$('#dialogTA').dialog({
				
				width: 500,
				modal: true,
				buttons: {
					"Ok": function() { 
						$(this).dialog("close"); 
					} 
					 
				}
			});
			
			return false;
		}
		else
		{
			changeSearchText('2');
			return true;
		}
		
		
	}
}


function setCounter(checkbox,whichgroup) {
	var val = document.getElementById(whichgroup).value;	
	var intval = parseInt(val);
	
	var checked = checkbox.checked;	
	
	if(checked)	
		intval++;
	else
		intval--;
			
	document.getElementById(whichgroup).value = intval;

}

function changeSearchText(type)
{
	
	
	$('#search-progress'+type).show();
	$('#searchbutton').attr("disabled", true);

}
