
Element.prototype.transform = function() {
    var properties = ['transform', 'WebkitTransform', 'MozTransform'];
    var p;
    while (p = properties.shift()) {
        if (typeof this.style[p] != 'undefined') {
            return p;
        }
    }
    return false;
}

$.fn.makeAbsolute = function(rebase) {
    this.each(function() {
        var el = $(this);
        var pos = el.offset();
        el.css({ top: pos.top, left: pos.left });
    });
    
    this.each(function() {
        $(this).css({ position: "absolute", marginLeft: 0, marginTop: 0 });
    });
    
    if (rebase)
        this.each(function() { 
            $(this).remove().appendTo("body");
            });
    
    return this;
}
