jQuery.fn.center = function (offsetX, offsetY) {
    this.css("position","absolute");
    this.css("top", ( $j(window).height() / 2 - this.height() / 2 ) + $j(window).scrollTop() + offsetY+ "px");
    this.css("left", ( $j(window).width() / 2 - this.width() / 2 ) + $j(window).scrollLeft() + offsetX + "px");
    return this;
}

jQuery.fn.centerToOtherElement = function (theElement) {
    this.css("position","absolute");
    this.css("top", ( $j(theElement).height() - parseInt(this.css('height')) ) / 2 + "px");
    this.css("left", ( $j(theElement).width() - parseInt(this.css('width')) ) / 2 + "px");
    return this;
}

jQuery.fn.resizeToWindow = function () {
    this.css("position","absolute");
    this.css("top", $j(window).scrollTop() + "px");
    this.css("left", $j(window).scrollLeft() + "px");
    this.css("width", $j(window).width() + "px");
    this.css("height", $j(window).height() + "px");
    return this;
}

jQuery.fn.alignToTop = function () {
    this.css("position","absolute");
    this.css("top", $j(window).scrollTop() + 10 + "px");
    return this;
}
