	$(function() {

		//-------- hover select example
		$('#sort2 li a.selected').live('mouseover', function() {
			$('#sort2 li a.option:not(.selected)').show();			
			return false;
		}); 
		
		//check for selecting a new option
		$('#sort2 li a.option').live('click', function() {
			//change over the selected class
			$('#sort2 li a').removeClass('selected');
			//apply this to the new selection
			$(this).addClass('selected');
			
			//slide up the selected option
			$('#sort2 li a.option:not(.selected)').hide();		
			
			return false;
		});
		
		//-------- advanced example
		$('#bannerSelect li a.selected').live('click', function() {
			//check if the options are visible
			if( $('#bannerSelect li a.option:visible').length > 1) {
				//hide the options if currently displaying
				$('#bannerSelect li a.option:not(.selected)').hide();			
			} else {
				//show the options if hidden
				$('#bannerSelect li a.option:not(.selected)').show();
			}
			
			return false;
		}); 
		
		//check for selecting a new option
		$('#bannerSelect li a.option:not(.selected)').live('click', function() {
			//change over the selected class
			$('#bannerSelect li a').removeClass('selected');
			//apply this to the new selection
			$(this).addClass('selected');
			if($(this).html() !== 'Min Price')
			{
				document.getElementById('price_range_from').value = $(this).html();
			}else{
					document.getElementById('price_range_from').value = 0;
			}
			//slide up the selected option
			$('#bannerSelect li a.option:not(.selected)').hide();			
			return false;
		});
		
		//-------- advanced example
		$('#bannerSelect1 li a.selected').live('click', function() {
			//check if the options are visible
			if( $('#bannerSelect1 li a.option:visible').length > 1) {
				//hide the options if currently displaying
				$('#bannerSelect1 li a.option:not(.selected)').hide();			
			} else {
				//show the options if hidden
				$('#bannerSelect1 li a.option:not(.selected)').show();			
			}
			return false;
		}); 
		
		//check for selecting a new option
		$('#bannerSelect1 li a.option:not(.selected)').live('click', function() {
			//change over the selected class
			$('#bannerSelect1 li a').removeClass('selected');
			//apply this to the new selection
			$(this).addClass('selected');
			if($(this).html() !== 'Max Price')
			{
				document.getElementById('price_range_to').value = $(this).html();
			}else{
					document.getElementById('price_range_to').value = 0;
			}
			//slide up the selected option
			$('#bannerSelect1 li a.option:not(.selected)').hide();			
			return false;
		});
		
		//-------- advanced example
		$('#bannerSelect2 li a.selected').live('click', function() {
			//check if the options are visible
			if( $('#bannerSelect2 li a.option:visible').length > 1) {
				//hide the options if currently displaying
				$('#bannerSelect2 li a.option:not(.selected)').hide();			
			} else {
				//show the options if hidden
				$('#bannerSelect2 li a.option:not(.selected)').show();			
			}
			return false;
		}); 
		
		//check for selecting a new option
		$('#bannerSelect2 li a.option:not(.selected)').live('click', function() {
			//change over the selected class
			$('#bannerSelect2 li a').removeClass('selected');
			//apply this to the new selection
			$(this).addClass('selected');
			if($(this).html() !== 'Min Bed')
			{
				document.getElementById('bedrooms').value = $(this).html();
			}else{
					document.getElementById('bedrooms').value = 0;
			}
			//slide up the selected option
			$('#bannerSelect2 li a.option:not(.selected)').hide();			
			return false;
		});

		//-------- populate form examples
		$('#sort4 li a.selected').live('click', function() {
			//check if the options are visible
			if( $('#sort4 li a.option:visible').length > 1) {
				//hide the options if currently displaying
				$('#sort4 li a.option:not(.selected)').hide();			
			} else {
				//show the options if hidden
				$('#sort4 li a.option:not(.selected)').show();			
			}
			return false;
		}); 
		
		//check for selecting a new option
		$('#sort4 li a.option:not(.selected)').live('click', function() {
			//change over the selected class
			$('#sort4 li a').removeClass('selected');
			//apply this to the new selection
			$(this).addClass('selected');
			//update the select option
			$("input[name='option']").val( $(this).attr('title') );
			//slide up the selected option
			$('#sort4 li a.option:not(.selected)').hide();			
			return false;
		});		
		
	});

