function loader(id) {

    // айдишник
    this.id = "loader";
    // если айдишник другой - запишем
    if(id) this.id = id;
    // ширина
    this.width = $("#" + this.id).width();
    // высота
    this.height = $("#" + this.id).height();
    // время показа
    this.tOpen = 100;
    // скрытия
    this.tClose = 300;
    
    // двигаем лоадер
    this.move = function(e) {
         $("#" + this.id).css({
             top: e.pageY - 30,
             left: e.pageX + 5
         });
    }

    // показать лоадер
    this.show = function() {
        $("#" + this.id).stop(true, true).fadeIn(this.tOpen);
    }

    // спрятать лоадер
    this.hide = function() {
        $("#" + this.id).stop(true, true).fadeOut(this.tClose);
    }

}

$(document).ready(function(){

    // добавляем контейнер лоадера
    $("body").prepend("<div id=\"" + l.id + "\"></div>");

    $(document).mousemove(function(e){
        l.move(e);
    });

});
