$(document).ready(function() {
	if ($('#ads').length!=0) $('.search input[type="image"]').hide();
	$('#search_keywords').keyup(function(key) {
		if ((this.value.length >= 3) && $('#ads').length!=0) {
			var query = this.value;
			$('#loader').show();
			$('#ewmapzone').load(
					$(this).parents('form').attr('action'),
					{ query: this.value + '*' },
					function() { $('#loader').hide();$('#infogeouser').html($('#new-infogeouser').html().replace("%s",query));mapsize();cremap(); }
			);
		}
	});
});
/*
$.fn.clearForm = function() {
	return this.each(function() {
		var type = this.type, tag = this.tagName.toLowerCase();
		if (tag == 'form')
			return $(':input',this).clearForm();
		if (type == 'text' || type == 'password' || tag == 'textarea')
			this.value = '';
		else if (type == 'checkbox' || type == 'radio')
			this.checked = false;
		else if (tag == 'select')
			this.selectedIndex = -1;
	});
};

jQuery.expr[':'].regex = function(elem, index, match) {
	var matchParams = match[3].split(','),
	validLabels = /^(data|css):/,
	attr = {
		method: matchParams[0].match(validLabels) ? 
				matchParams[0].split(':')[0] : 'attr',
				property: matchParams.shift().replace(validLabels,'')
	},
	regexFlags = 'ig',
	regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
	return regex.test(jQuery(elem)[attr.method](attr.property));
}
*/
