jQuery.fn.searchbox = function(options) {
	$this = jQuery(this);
	$options = options || {};

	var dc = function(e){return document.createElement(e);};

	if (!$options.button_title) {
		$options.button_title = 'GO';
	}

	var $input = dc('input');
	var code = jQuery($input)
				.attr({'class': 'searchfield',
						'type': 'text',
						'name': 'QueryString'});

	$this.replaceWith(code);

	code.after(jQuery(dc('a'))
				.attr({'class': 'searchbtn', 'href': '#'})
				.text($options.button_title)
				.click(function() {
					if ($input.value != $input.defaultValue)
						$input.form.submit();
				}));

	$input.focus();

	return this;
}

