
//function setMinChars(iChars)
//{
//	A1.options.minChars = iChars;
//}

function zipfinder_choose()
{
	var newval;
	newval = jQuery('#zipfinder_zipcode').val();
	jQuery('#zipcode').val(newval);
	window.location = '/searches/searchSmart/' + newval;
}

function zipfinder_loading(type)
{
	if (type == 'state')
	{
//		jQuery('#zipfinder_city').html('<option>Loading...</option>');
	}
	else if (type == 'city')
	{
//		jQuery('#zipfinder_zipcode').html('<option>Loading...</option>');
	}
}

function changeSearchType(type)
{
	if (type == 'city')
	{
		if (jQuery('#search_link_1').html() == 'City/State')
		{
			jQuery('input.searchbox').val('Enter City And State');
			jQuery('#search_link_1').html('Zip Code');
			jQuery('#search_link_2').html('Business Name');
			//enable autocompleter
//			setMinChars(3);
		}
		else
		{
			jQuery('input.searchbox').val('Enter Zip Code');
			jQuery('#search_link_1').html('City/State');
			//enable autocompleter
//			setMinChars(3);
		}
		jQuery('#home_search_form').attr('action', '/searches/searchSmart');
		jQuery('#search_link_1').blur();
	}
	else if (type == 'business')
	{

		if (jQuery('#search_link_2').html() == 'Business Name')
		{
			jQuery('input.searchbox').val('Enter Business Name');
			jQuery('#home_search_form').attr('action', '/searches/businessSearch');
			jQuery('#search_link_2').html('Zip Code');
			//make sure the other link now says 'City/State'
			jQuery('#search_link_1').html('City/State');
			//disable autocompleter
//			setMinChars(999);
		}
		else
		{
			jQuery('input.searchbox').val('Enter Zip Code');
			jQuery('#home_search_form').attr('action', '/searches/smartSearch');
			jQuery('#search_link_2').html('Business Name');
			//enable autocompleter
//			setMinChars(3);
		}
		jQuery('#search_link_2').blur();
	}
	else
	{
		jQuery('input.searchbox').val('Enter Zip Code');
		jQuery('#home_search_form').attr('action', '/searches/searchSmart');
		jQuery('#search_link_1').blur();
		jQuery('#search_link_2').blur();
		//enable autocompleter
//		setMinChars(3);
	}
}
