$.fn.image = function(src, f){ 
  return this.each(function(){ 
    var i = new Image(); 
    i.src = src; 
    i.onload = f; 
    this.appendChild(i);
  }); 
}

$.fn.src = function(src, f){ 
    return this.each(function(){
        $(this).load(function() {
            $(this).show();
        //    $(this).parents('.loading:first').replaceWith($(this).parent().html());
            if (f) {
                f();
            }
        });
        $(this).hide();
        //$(this).wrap('<div class="loading" style="margin: auto"><img src="/media/images/common/loadingAnimation.gif" alt="loading"/><div class="load_item"></div></div>');
        $(this).attr('src', src);
    }); 
}

$.fn.smoothload = function(src, f){ 
    return this.each(function(){
        $(this).hide();
        //$(this).wrap('<div class="loading" style="margin: auto"><img src="/media/images/common/loadingAnimation.gif" alt="loading"/><div class="load_item"></div></div>');
        $(this).load(src, function() {
            $(this).show();
        //    $(this).parents('.loading:first').replaceWith($(this).parent().html());
            if (f) {
                f();
            }
        });
    }); 
}
