/**
 *
 * @author Nick Mallare
 * @copyright 2010
 */
$( function() {
	$('#reset').bind( 'click', function() {
		//NOTE: This is here because of a limitation in the way the site is
		//	coded. If the user has a neighborhood selected, then they cannot
		//	'unselect' it to broaden their search.
		$('#type2_id_237').attr( 'checked', 'checked' );
		/******************************************************************/
		$(location).attr( 'href', 'search_channel?'+$('#search').serialize() );
	});
	/**********************************************************************/
	//NOTE: We want to change the value of All to literally search on all.
	$('#type2_id_237').attr( 'value', '%' );
	/**********************************************************************/
	//NOTE: If the user has 'reset' the form or selected All, then we want
	//	to make it appear as though the All button is selected, even
	//	though it is impossible for it to ever actually be selected.
	if( $(location).attr('href').match(/type2_id%5B%5D=%25/i) == 'type2_id%5B%5D=%25' )
		$('#type2_id_237').attr( 'checked', 'checked' );
});
