// JavaScript Document
/**
 * Filters list of items by county
 * @see service
 * @see jobs
 * @see right-column
 * @param string Name of the county to filter by
 */
function filterByCounty(countyName) 
{
	jQuery('.county-item a').each(function(){
		if (countyName.length > 0) {
			// show/hide items
			counties = jQuery(this).attr('rel');
			if (counties && counties.indexOf(countyName) < 0){
				if (jQuery(this).parent().css('display') != 'none')
					jQuery(this).parent().slideUp();
			} else if (jQuery(this).parent().css('display') == 'none') {
				jQuery(this).parent().slideDown();
			}
		} else {
			// show all items
			if (jQuery(this).parent().css('display') == 'none') {
				jQuery(this).parent().slideDown();
			}
		}
	});
}
