/* 
 * Requires: jQuery 1.2+
 */

(function($){
	
$.fn.left = function(newValue) {
	if(newValue!=null) this.css("left", newValue);
	if(this.offset==undefined) return this.offsetLeft;
	if(this.offset()==undefined) return this.offsetLeft;
	return this.offset().left;
};

$.fn.top = function(newValue) {
	if(newValue!=null) this.css("top", newValue);
	if(this.offset==undefined) return this.offsetTop;
	if(this.offset()==undefined) return this.offsetTop;
	return this.offset().top;
}

$.fn.bottom = function() {
	return this.top() + this.height();
}

$.fn.right = function() {
	return this.left() + this.width();
}

$.fn.display = function(newValue) {
	if(newValue!=null) this.css("display", newValue);
	return this.css("display");
}

})(jQuery);