var SmartyAjax = 
{
  show_loader: function(update_id) 
  {
	 document.getElementById('ajax_loader').style.display = 'inline';
  },
  
  hide_loader: function(response) 
  {
	 document.getElementById('ajax_loader').style.display = 'none';
  },
  
  update: function(update_id, url, method, params) 
  {
    var myAjax = new Ajax.Updater
	(
      update_id,
      url,
      {
        method: method,
        parameters: params,
		onBegin: this.show_loader,
		onComplete: this.hide_loader
      }
	 );
  },

  submit: function(form, params, update_id) 
  {
	//this.show_loader(update_id);
	
    var myAjax = new Ajax.Updater
	(
      update_id,
      form.action,
      {
        method: form.method,
        parameters: Form.serialize(form.id),
		onBegin: this.show_loader,
		onComplete: this.hide_loader,
      }
	 );
  }
}