/**
 * @script: servizi.js
 * @website: Il Borgo - La Via dello Shopping <http://laviadelloshopping.com/>
 * @last-update: 2008-07-04
 * @version: 1.0
 *
 * Current MooTools version: 1.2 stable <http://mootools.net/>
 *
 * @author: Leonardo Laureti <l.laureti@syn-ergo.com>
 * @copyright: 2008 Syn-Ergo snc, <http://syn-ergo.com/>
 *
 * Tested:
 * 	Safari 2+
 * 	Firefox 1.5+
 * 	Opera 9+
 * 	IE 6+
*/

window.addEvent('domready', function(){

	var codice = $('codice');
	codice.addEvent('submit', function(event){
		event.stop();
		var req = new Request.HTML({
			url: codice.get('action'),
			onRequest: function(){
				codice.empty();
				codice.addClass('loading');
			},
			onComplete: function(){
				codice.removeClass('loading');
			},
			update: codice
		}).post(codice);
	});

/*	var location = $('location');
	var location_map = $('location-map');
	location.addEvent('submit', function(event){
		event.stop();
		var req = new Request.HTML({
			url: location.get('action'),
			onRequest: function(){
				location_map.empty();
				location_map.addClass('loading');
			},
			onSuccess: function(tree, element, text, js){
				location_map.removeClass('loading');
					if(map_finded == true){
					var inner_map = new Element('div', {'id': 'inner-map', 'html': text});
					inner_map.inject(location_map);
				} else {
					location_map.set('html', text);
				}
			},		
		}).post(location);
	});*/

});