$('ricerca').addEvent('keyup', function(e) {
	e = new Event(e).stop();
 	r = $('ricerca').value;	
	a = $('anno').value;
	t = $('tipo').value;
	
	var url = "http://www.comune.pecetto.to.it/srv/search_results.php?ricerca="+r+"&anno="+a+"&tipo="+t;
 
	/**
	 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
	 * to do add your own Ajax depended code.
	 */
	new Ajax(url, {
		method: 'get',
		update: $('search_results')
	}).request();
});

$('anno').addEvent('change', function(e) {
	e = new Event(e).stop();
 	r = $('ricerca').value;	
	a = $('anno').value;
	t = $('tipo').value;
	
	var url = "http://www.comune.pecetto.to.it/srv/search_results.php?ricerca="+r+"&anno="+a+"&tipo="+t;
 
	/**
	 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
	 * to do add your own Ajax depended code.
	 */
	new Ajax(url, {
		method: 'get',
		update: $('search_results')
	}).request();
});

window.addEvent('domready', function() {
	t = $('tipo').value;
	a = $('anno').value;
	
	var url = "http://www.comune.pecetto.to.it/srv/search_results.php?anno="+a+"&tipo="+t;	
	
	/**
	 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
	 * to do add your own Ajax depended code.
	 */
	new Ajax(url, {
		method: 'get',
		update: $('search_results')
	}).request();
});