
jQuery(function($) {

	/*
	 * I just discovered that
	 *
	 * 	`jQuery(function($)`
	 *
	 * can be used as an alias for
	 *
	 * 	`jQuery(document).ready(function($))`
	 *
	 * Nice.
	 * http://www.learningjquery.com/2006/09/introducing-document-ready#comment-6
	 *
	 * The below function is derived from Matt Ryall's filter demo:
	 * http://www.mattryall.net/blog/2008/07/jquery-filter-demo
	 */

	$('#cityfilter select').change(function () {

		var filter = $(this).val();

		if ( !filter )
			return $('#eventlisting li').slideDown();

		$('#eventlisting li').each(function () {
			if ( filter != $('.city',this).text() )
				$(this).slideUp();
			else
				$(this).slideDown();
		});

	} );

	$('#cityfilter').show();

} );

