var path = 'http://www.homesbythehorn.com/';
$('document').ready(function() {
	$('#mls_go').live('click',function() {
		var city = $('#search_city').val();
		var price = $('#search_price').val();
		var beds = $('#search_beds').val();
		var baths = $('#search_baths').val();
		
		var new_location = path + 'featured/?search=1';
		if(city) {
			new_location += '&city=' + escape(city);
		}
		if(price) {
			var price_min = 0;
			var price_max = 0;
			switch(price) {
				case '1':
					price_max = 50000;
					break;
				case '2':
					price_min = 50000;
					price_max = 100000;
					break;
				case '3':
					price_min = 100000;
					price_max = 200000;
					break;
				case '4':
					price_min = 200000;
					price_max = 300000;
					break;
				case '5':
					price_min = 300000;
					price_max = 400000;
					break;
				case '6':
					price_max = 400000;
					break;
			}
			if(price_min) {
				new_location += '&price_min=' + price_min;
			}
			if(price_max) {
				new_location += '&price_max=' + price_max;
			}
		}
		if(beds) {
			new_location += '&beds=' + beds;
		}
		if(baths) {
			new_location += '&baths=' + baths;
		}
		location = new_location;
		return false;
	});
});

