$('#id_keyword').addInputPromptText({'text':'标题/描述'});
$('#id_b, #id_e, #id_m, #id_z').onlyPressNum();
$('#id_keyword, #id_b, #id_e, #id_m, #id_z').keypress(function(evt){
	if(evt.keyCode==13){
		keyword_search();
	}
});

function keyword_search()
{
	$('#id_keyword').fixInputPromptText();
	
	var url = $('#id_rooturl').val();
	var fix = '/';
	var buf = [];
	$(':input',$('#changeCounty_new, #search_options')).each(function(){
		if (this.name) {
			var name = this.name;
			if (this.name == 'price_type') {
				if ($('#id_b').val().length != 0 || $('#id_e').val().length != 0) {
					buf.push('p' + $(this).val());
				}
			}
			else {
				var val = $(this).val();
				if (val.length > 0) {
					buf.push(name + val);
				}
			}
		}
	});
	var text = $('#id_keyword').val();
	//text = text.replace('/', '');
	text = text.replace(/\//g,'');
	if (text.length>0) {
		buf.push('_' + encodeURIComponent(text));
	} 
	url += buf.join('');
	url += fix;
	url = url.replace(/\/\/$/, '/');
	window.location = url;
	return false;
}