(function (jQuery) {

	jQuery.topZIndex = function (selector) {
		return Math.max(0, Math.max.apply(null, jQuery.map(((selector || "*") === "*") ? jQuery.makeArray(document.getElementsByTagName("*")) : jQuery(selector),
			function (v) {
				return parseFloat(jQuery(v).css("z-index")) || null;
			}
		)));
	};

	jQuery.fn.topZIndex = function (opt) {
		if (this.length === 0) {
			return this;
		}
		opt = jQuery.extend({increment: 1}, opt);
		var zmax = jQuery.topZIndex(opt.selector),
			inc = opt.increment;
		return this.each(function () {
			this.style.zIndex = (zmax += inc);
		});
	};

	jQuery.blockElement = function () {
		var body = jQuery("body");
		alert(body.html());
		body.add("div").css("position", "fixed").css("bottom", 0).css("left", 0).css("right", 0).css("top", 0).css("background-color", "#000");
	};

	jQuery.isUndefined = function (obj) {
		return typeof(obj) === "undefined";
	}

	jQuery.isX = function (obj) {
		return jQuery.isUndefined(obj) || isNaN(obj);
	}

	jQuery.uvl = function (obj, val) {
		return jQuery.isUndefined(obj) ? val : obj;
	}

	jQuery.xvl = function (obj, val) {
		return (jQuery.isUndefined(obj) || isNaN(obj)) ? val : obj;
	}
})(jQuery);