var ls = {
	url:'',
	search_form:'searchform',
	
	init:function() {
		var s = $('s');
		s.autocomplete = 'off';
		new Form.Element.Observer(s, 1.0, ls.show_results);
		new Insertion.Bottom(ls.search_form, '<div id="addicted_results"></div>');
	},
	
	show_results:function(element, value) {
		ls.show_page(value, 1);
	},
	
	show_page:function(s, page) {
		var pars = 's=' + s + '&paged=' + page;
		new Ajax.Updater('addicted_results', ls.url, {
			method: 'get',
			parameters: pars,
			onComplete:function() {
				var p = $$('#previous_results a');
				var n = $$('#next_results a');
				
				// attach handlers for next and previous pages
			}
		});
	}
}

Event.observe(window, 'load', ls.init, false);
