jQuery.fn.ajaxContent = function(){
  this.each(function(){
    jQuery(this).css( 'position', 'relative');
    jQuery(this).append( '<div class="saving_ajax_content"></div>');
  });
}
jQuery.fn.ajaxContentRemove = function(){
  this.each(function(){
    jQuery(this).css( 'position', 'relative');
    jQuery(this).find('.saving_ajax_content').remove();
  });
}

function ToggleSelect( id_select, options) {
    this.id_select = '#'+id_select;
    this._options = options;
    $(this.id_select).bind( 'change', jQuery.proxy( this, 'actua'));
    this.actua ();
}

ToggleSelect.prototype = {

  actua:      function (e) {
              var seleccionada = $(this.id_select).val();
              var el_selected = null;
              
              for (var a = 0 ; a < this._options.length ; a++)
              {
                if( this._options[a][0] == seleccionada || this._options[a][1] == el_selected)
                {
                  style = 'block';
                  el_selected = this._options[a][1];
                }
                else
                {
                  style = 'none';
                }

                if ($('#'+this._options[a][1]))
                  $('#'+this._options[a][1]).css( 'display', style);  
              }
            }
};
