/*
 * Work loader
 * 
 * 2007 - Magic Wand
 */

ns('Aexpo');

ns.Aexpo.WorkLoader = function(text_place, url) {
  this.text_place = text_place;
  this.url = url;
  this.loaded = 0;  
}

ns.Aexpo.WorkLoader.prototype = {
  
  load: function(id) {
    if(this.loaded == id) return;
    this.loaded = id;
    var _this = this;
    $(this.text_place).fadeOut('fast', function() { 
      /*$(_this.text_place).load(_this.url, {'id': id}, function() {
        $(_this.text_place).fadeIn('fast');
      })*/    
      $.post(_this.url, {'id': id}, function(data) {
        if(data.indexOf('work_info_' + _this.loaded) >= 0) {
          $(_this.text_place).html(data).fadeIn('fast');           
        }        
      }, 'html');    
    });
  }
  
}

