--- /dev/null
+/*\r
+ * jQuery blockUI plugin\r
+ * Version 1.33 (09/14/2007)\r
+ * @requires jQuery v1.1.1\r
+ *\r
+ * $Id: jquery.blockUI.js 3291 2007-09-14 23:56:25Z malsup $\r
+ *\r
+ * Examples at: http://malsup.com/jquery/block/\r
+ * Copyright (c) 2007 M. Alsup\r
+ * Dual licensed under the MIT and GPL licenses:\r
+ * http://www.opensource.org/licenses/mit-license.php\r
+ * http://www.gnu.org/licenses/gpl.html\r
+ */\r
+ (function($) {\r
+/**\r
+ * blockUI provides a mechanism for blocking user interaction with a page (or parts of a page).\r
+ * This can be an effective way to simulate synchronous behavior during ajax operations without\r
+ * locking the browser. It will prevent user operations for the current page while it is\r
+ * active ane will return the page to normal when it is deactivate. blockUI accepts the following\r
+ * two optional arguments:\r
+ *\r
+ * message (String|Element|jQuery): The message to be displayed while the UI is blocked. The message\r
+ * argument can be a plain text string like "Processing...", an HTML string like\r
+ * "<h1><img src="busy.gif" /> Please wait...</h1>", a DOM element, or a jQuery object.\r
+ * The default message is "<h1>Please wait...</h1>"\r
+ *\r
+ * css (Object): Object which contains css property/values to override the default styles of\r
+ * the message. Use this argument if you wish to override the default\r
+ * styles. The css Object should be in a format suitable for the jQuery.css\r
+ * function. For example:\r
+ * $.blockUI({\r
+ * backgroundColor: '#ff8',\r
+ * border: '5px solid #f00,\r
+ * fontWeight: 'bold'\r
+ * });\r
+ *\r
+ * The default blocking message used when blocking the entire page is "<h1>Please wait...</h1>"\r
+ * but this can be overridden by assigning a value to $.blockUI.defaults.pageMessage in your\r
+ * own code. For example:\r
+ *\r
+ * $.blockUI.defaults.pageMessage = "<h1>Bitte Wartezeit</h1>";\r
+ *\r
+ * The default message styling can also be overridden. For example:\r
+ *\r
+ * $.extend($.blockUI.defaults.pageMessageCSS, { color: '#00a', backgroundColor: '#0f0' });\r
+ *\r
+ * The default styles work well for simple messages like "Please wait", but for longer messages\r
+ * style overrides may be necessary.\r
+ *\r
+ * @example $.blockUI();\r
+ * @desc prevent user interaction with the page (and show the default message of 'Please wait...')\r
+ *\r
+ * @example $.blockUI( { backgroundColor: '#f00', color: '#fff'} );\r
+ * @desc prevent user interaction and override the default styles of the message to use a white on red color scheme\r
+ *\r
+ * @example $.blockUI('Processing...');\r
+ * @desc prevent user interaction and display the message "Processing..." instead of the default message\r
+ *\r
+ * @name blockUI\r
+ * @param String|jQuery|Element message Message to display while the UI is blocked\r
+ * @param Object css Style object to control look of the message\r
+ * @cat Plugins/blockUI\r
+ */\r
+$.blockUI = function(msg, css, opts) {\r
+ $.blockUI.impl.install(window, msg, css, opts);\r
+};\r
+\r
+// expose version number so other plugins can interogate\r
+$.blockUI.version = 1.33;\r
+\r
+/**\r
+ * unblockUI removes the UI block that was put in place by blockUI\r
+ *\r
+ * @example $.unblockUI();\r
+ * @desc unblocks the page\r
+ *\r
+ * @name unblockUI\r
+ * @cat Plugins/blockUI\r
+ */\r
+$.unblockUI = function(opts) {\r
+ $.blockUI.impl.remove(window, opts);\r
+};\r
+\r
+/**\r
+ * Blocks user interaction with the selected elements. (Hat tip: Much of\r
+ * this logic comes from Brandon Aaron's bgiframe plugin. Thanks, Brandon!)\r
+ * By default, no message is displayed when blocking elements.\r
+ *\r
+ * @example $('div.special').block();\r
+ * @desc prevent user interaction with all div elements with the 'special' class.\r
+ *\r
+ * @example $('div.special').block('Please wait');\r
+ * @desc prevent user interaction with all div elements with the 'special' class\r
+ * and show a message over the blocked content.\r
+ *\r
+ * @name block\r
+ * @type jQuery\r
+ * @param String|jQuery|Element message Message to display while the element is blocked\r
+ * @param Object css Style object to control look of the message\r
+ * @cat Plugins/blockUI\r
+ */\r
+$.fn.block = function(msg, css, opts) {\r
+ return this.each(function() {\r
+ if (!this.$pos_checked) {\r
+ if ($.css(this,"position") == 'static')\r
+ this.style.position = 'relative';\r
+ if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE\r
+ this.$pos_checked = 1;\r
+ }\r
+ $.blockUI.impl.install(this, msg, css, opts);\r
+ });\r
+};\r
+\r
+/**\r
+ * Unblocks content that was blocked by "block()"\r
+ *\r
+ * @example $('div.special').unblock();\r
+ * @desc unblocks all div elements with the 'special' class.\r
+ *\r
+ * @name unblock\r
+ * @type jQuery\r
+ * @cat Plugins/blockUI\r
+ */\r
+$.fn.unblock = function(opts) {\r
+ return this.each(function() {\r
+ $.blockUI.impl.remove(this, opts);\r
+ });\r
+};\r
+\r
+/**\r
+ * displays the first matched element in a "display box" above a page overlay.\r
+ *\r
+ * @example $('#myImage').displayBox();\r
+ * @desc displays "myImage" element in a box\r
+ *\r
+ * @name displayBox\r
+ * @type jQuery\r
+ * @cat Plugins/blockUI\r
+ */\r
+$.fn.displayBox = function(css, fn, isFlash) {\r
+ var msg = this[0];\r
+ if (!msg) return;\r
+ var $msg = $(msg);\r
+ css = css || {};\r
+\r
+ var w = $msg.width() || $msg.attr('width') || css.width || $.blockUI.defaults.displayBoxCSS.width;\r
+ var h = $msg.height() || $msg.attr('height') || css.height || $.blockUI.defaults.displayBoxCSS.height ;\r
+ if (w[w.length-1] == '%') {\r
+ var ww = document.documentElement.clientWidth || document.body.clientWidth;\r
+ w = parseInt(w) || 100;\r
+ w = (w * ww) / 100;\r
+ }\r
+ if (h[h.length-1] == '%') {\r
+ var hh = document.documentElement.clientHeight || document.body.clientHeight;\r
+ h = parseInt(h) || 100;\r
+ h = (h * hh) / 100;\r
+ }\r
+\r
+ var ml = '-' + parseInt(w)/2 + 'px';\r
+ var mt = '-' + parseInt(h)/2 + 'px';\r
+\r
+ // supress opacity on overlay if displaying flash content on mac/ff platform\r
+ var ua = navigator.userAgent.toLowerCase();\r
+ var opts = {\r
+ displayMode: fn || 1,\r
+ noalpha: isFlash && /mac/.test(ua) && /firefox/.test(ua)\r
+ };\r
+\r
+ $.blockUI.impl.install(window, msg, { width: w, height: h, marginTop: mt, marginLeft: ml }, opts);\r
+};\r
+\r
+\r
+// override these in your code to change the default messages and styles\r
+$.blockUI.defaults = {\r
+ // the message displayed when blocking the entire page\r
+ pageMessage: '<h1>Please wait...</h1>',\r
+ // the message displayed when blocking an element\r
+ elementMessage: '', // none\r
+ // styles for the overlay iframe\r
+ overlayCSS: { backgroundColor: '#fff', opacity: '0.5' },\r
+ // styles for the message when blocking the entire page\r
+ pageMessageCSS: { width:'250px', margin:'-50px 0 0 -125px', top:'50%', left:'50%', textAlign:'center', color:'#000', backgroundColor:'#fff', border:'3px solid #aaa' },\r
+ // styles for the message when blocking an element\r
+ elementMessageCSS: { width:'250px', padding:'10px', textAlign:'center', backgroundColor:'#fff'},\r
+ // styles for the displayBox\r
+ displayBoxCSS: { width: '400px', height: '400px', top:'50%', left:'50%' },\r
+ // allow body element to be stetched in ie6\r
+ ie6Stretch: 1,\r
+ // supress tab nav from leaving blocking content?\r
+ allowTabToLeave: 0,\r
+ // Title attribute for overlay when using displayBox\r
+ closeMessage: 'Click to close',\r
+ // use fadeOut effect when unblocking (can be overridden on unblock call)\r
+ fadeOut: 1,\r
+ // fadeOut transition time in millis\r
+ fadeTime: 400\r
+};\r
+\r
+// the gory details\r
+$.blockUI.impl = {\r
+ box: null,\r
+ boxCallback: null,\r
+ pageBlock: null,\r
+ pageBlockEls: [],\r
+ op8: window.opera && window.opera.version() < 9,\r
+ ie6: $.browser.msie && /MSIE 6.0/.test(navigator.userAgent),\r
+ install: function(el, msg, css, opts) {\r
+ opts = opts || {};\r
+ this.boxCallback = typeof opts.displayMode == 'function' ? opts.displayMode : null;\r
+ this.box = opts.displayMode ? msg : null;\r
+ var full = (el == window);\r
+\r
+ // use logical settings for opacity support based on browser but allow overrides via opts arg\r
+ var noalpha = this.op8 || $.browser.mozilla && /Linux/.test(navigator.platform);\r
+ if (typeof opts.alphaOverride != 'undefined')\r
+ noalpha = opts.alphaOverride == 0 ? 1 : 0;\r
+\r
+ if (full && this.pageBlock) this.remove(window, {fadeOut:0});\r
+ // check to see if we were only passed the css object (a literal)\r
+ if (msg && typeof msg == 'object' && !msg.jquery && !msg.nodeType) {\r
+ css = msg;\r
+ msg = null;\r
+ }\r
+ msg = msg ? (msg.nodeType ? $(msg) : msg) : full ? $.blockUI.defaults.pageMessage : $.blockUI.defaults.elementMessage;\r
+ if (opts.displayMode)\r
+ var basecss = jQuery.extend({}, $.blockUI.defaults.displayBoxCSS);\r
+ else\r
+ var basecss = jQuery.extend({}, full ? $.blockUI.defaults.pageMessageCSS : $.blockUI.defaults.elementMessageCSS);\r
+ css = jQuery.extend(basecss, css || {});\r
+ var f = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')\r
+ : $('<div class="blockUI" style="display:none"></div>');\r
+ var w = $('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');\r
+ var m = full ? $('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>')\r
+ : $('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>');\r
+ w.css('position', full ? 'fixed' : 'absolute');\r
+ if (msg) m.css(css);\r
+ if (!noalpha) w.css($.blockUI.defaults.overlayCSS);\r
+ if (this.op8) w.css({ width:''+el.clientWidth,height:''+el.clientHeight }); // lame\r
+ if ($.browser.msie) f.css('opacity','0.0');\r
+\r
+ $([f[0],w[0],m[0]]).appendTo(full ? 'body' : el);\r
+\r
+ // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)\r
+ var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0);\r
+ if (this.ie6 || expr) {\r
+ // stretch content area if it's short\r
+ if (full && $.blockUI.defaults.ie6Stretch && $.boxModel)\r
+ $('html,body').css('height','100%');\r
+\r
+ // fix ie6 problem when blocked element has a border width\r
+ if ((this.ie6 || !$.boxModel) && !full) {\r
+ var t = this.sz(el,'borderTopWidth'), l = this.sz(el,'borderLeftWidth');\r
+ var fixT = t ? '(0 - '+t+')' : 0;\r
+ var fixL = l ? '(0 - '+l+')' : 0;\r
+ }\r
+\r
+ // simulate fixed position\r
+ $.each([f,w,m], function(i,o) {\r
+ var s = o[0].style;\r
+ s.position = 'absolute';\r
+ if (i < 2) {\r
+ full ? s.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"')\r
+ : s.setExpression('height','this.parentNode.offsetHeight + "px"');\r
+ full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')\r
+ : s.setExpression('width','this.parentNode.offsetWidth + "px"');\r
+ if (fixL) s.setExpression('left', fixL);\r
+ if (fixT) s.setExpression('top', fixT);\r
+ }\r
+ else {\r
+ if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');\r
+ s.marginTop = 0;\r
+ }\r
+ });\r
+ }\r
+ if (opts.displayMode) {\r
+ w.css('cursor','default').attr('title', $.blockUI.defaults.closeMessage);\r
+ m.css('cursor','default');\r
+ $([f[0],w[0],m[0]]).removeClass('blockUI').addClass('displayBox');\r
+ $().click($.blockUI.impl.boxHandler).bind('keypress', $.blockUI.impl.boxHandler);\r
+ }\r
+ else\r
+ this.bind(1, el);\r
+ m.append(msg).show();\r
+ if (msg.jquery) msg.show();\r
+ if (opts.displayMode) return;\r
+ if (full) {\r
+ this.pageBlock = m[0];\r
+ this.pageBlockEls = $(':input:enabled:visible',this.pageBlock);\r
+ setTimeout(this.focus, 20);\r
+ }\r
+ else this.center(m[0]);\r
+ },\r
+ remove: function(el, opts) {\r
+ var o = $.extend({}, $.blockUI.defaults, opts);\r
+ this.bind(0, el);\r
+ var full = el == window;\r
+ var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);\r
+ if (full) this.pageBlock = this.pageBlockEls = null;\r
+\r
+ if (o.fadeOut) {\r
+ els.fadeOut(o.fadeTime, function() {\r
+ if (this.parentNode) this.parentNode.removeChild(this);\r
+ });\r
+ }\r
+ else els.remove();\r
+ },\r
+ boxRemove: function(el) {\r
+ $().unbind('click',$.blockUI.impl.boxHandler).unbind('keypress', $.blockUI.impl.boxHandler);\r
+ if (this.boxCallback)\r
+ this.boxCallback(this.box);\r
+ $('body .displayBox').hide().remove();\r
+ },\r
+ // event handler to suppress keyboard/mouse events when blocking\r
+ handler: function(e) {\r
+ if (e.keyCode && e.keyCode == 9) {\r
+ if ($.blockUI.impl.pageBlock && !$.blockUI.defaults.allowTabToLeave) {\r
+ var els = $.blockUI.impl.pageBlockEls;\r
+ var fwd = !e.shiftKey && e.target == els[els.length-1];\r
+ var back = e.shiftKey && e.target == els[0];\r
+ if (fwd || back) {\r
+ setTimeout(function(){$.blockUI.impl.focus(back)},10);\r
+ return false;\r
+ }\r
+ }\r
+ }\r
+ if ($(e.target).parents('div.blockMsg').length > 0)\r
+ return true;\r
+ return $(e.target).parents().children().filter('div.blockUI').length == 0;\r
+ },\r
+ boxHandler: function(e) {\r
+ if ((e.keyCode && e.keyCode == 27) || (e.type == 'click' && $(e.target).parents('div.blockMsg').length == 0))\r
+ $.blockUI.impl.boxRemove();\r
+ return true;\r
+ },\r
+ // bind/unbind the handler\r
+ bind: function(b, el) {\r
+ var full = el == window;\r
+ // don't bother unbinding if there is nothing to unbind\r
+ if (!b && (full && !this.pageBlock || !full && !el.$blocked)) return;\r
+ if (!full) el.$blocked = b;\r
+ var $e = $(el).find('a,:input');\r
+ $.each(['mousedown','mouseup','keydown','keypress','click'], function(i,o) {\r
+ $e[b?'bind':'unbind'](o, $.blockUI.impl.handler);\r
+ });\r
+ },\r
+ focus: function(back) {\r
+ if (!$.blockUI.impl.pageBlockEls) return;\r
+ var e = $.blockUI.impl.pageBlockEls[back===true ? $.blockUI.impl.pageBlockEls.length-1 : 0];\r
+ if (e) e.focus();\r
+ },\r
+ center: function(el) {\r
+ var p = el.parentNode, s = el.style;\r
+ var l = ((p.offsetWidth - el.offsetWidth)/2) - this.sz(p,'borderLeftWidth');\r
+ var t = ((p.offsetHeight - el.offsetHeight)/2) - this.sz(p,'borderTopWidth');\r
+ s.left = l > 0 ? (l+'px') : '0';\r
+ s.top = t > 0 ? (t+'px') : '0';\r
+ },\r
+ sz: function(el, p) { return parseInt($.css(el,p))||0; }\r
+};\r
+\r
+})(jQuery);\r
--- /dev/null
+/* Copyright (c) 2007 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * Version: @VERSION
+ * Requires jQuery 1.1.3+
+ * Docs: http://docs.jquery.com/Plugins/livequery
+ */
+
+(function($) {
+
+$.extend($.fn, {
+ livequery: function(type, fn, fn2) {
+ var self = this, q;
+
+ // Handle different call patterns
+ if ($.isFunction(type))
+ fn2 = fn, fn = type, type = undefined;
+
+ // See if Live Query already exists
+ $.each( $.livequery.queries, function(i, query) {
+ if ( self.selector == query.selector && self.context == query.context &&
+ type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )
+ // Found the query, exit the each loop
+ return (q = query) && false;
+ });
+
+ // Create new Live Query if it wasn't found
+ q = q || new $.livequery(this.selector, this.context, type, fn, fn2);
+
+ // Make sure it is running
+ q.stopped = false;
+
+ // Run it
+ $.livequery.run( q.id );
+
+ // Contnue the chain
+ return this;
+ },
+
+ expire: function(type, fn, fn2) {
+ var self = this;
+
+ // Handle different call patterns
+ if ($.isFunction(type))
+ fn2 = fn, fn = type, type = undefined;
+
+ // Find the Live Query based on arguments and stop it
+ $.each( $.livequery.queries, function(i, query) {
+ if ( self.selector == query.selector && self.context == query.context &&
+ (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )
+ $.livequery.stop(query.id);
+ });
+
+ // Continue the chain
+ return this;
+ }
+});
+
+$.livequery = function(selector, context, type, fn, fn2) {
+ this.selector = selector;
+ this.context = context || document;
+ this.type = type;
+ this.fn = fn;
+ this.fn2 = fn2;
+ this.elements = [];
+ this.stopped = false;
+
+ // The id is the index of the Live Query in $.livequery.queries
+ this.id = $.livequery.queries.push(this)-1;
+
+ // Mark the functions for matching later on
+ fn.$lqguid = fn.$lqguid || $.livequery.guid++;
+ if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;
+
+ // Return the Live Query
+ return this;
+};
+
+$.livequery.prototype = {
+ stop: function() {
+ var query = this;
+
+ if ( this.type )
+ // Unbind all bound events
+ this.elements.unbind(this.type, this.fn);
+ else if (this.fn2)
+ // Call the second function for all matched elements
+ this.elements.each(function(i, el) {
+ query.fn2.apply(el);
+ });
+
+ // Clear out matched elements
+ this.elements = [];
+
+ // Stop the Live Query from running until restarted
+ this.stopped = true;
+ },
+
+ run: function() {
+ // Short-circuit if stopped
+ if ( this.stopped ) return;
+ var query = this;
+
+ var oEls = this.elements,
+ els = $(this.selector, this.context),
+ nEls = els.not(oEls);
+
+ // Set elements to the latest set of matched elements
+ this.elements = els;
+
+ if (this.type) {
+ // Bind events to newly matched elements
+ nEls.bind(this.type, this.fn);
+
+ // Unbind events to elements no longer matched
+ if (oEls.length > 0)
+ $.each(oEls, function(i, el) {
+ if ( $.inArray(el, els) < 0 )
+ $.event.remove(el, query.type, query.fn);
+ });
+ }
+ else {
+ // Call the first function for newly matched elements
+ nEls.each(function() {
+ query.fn.apply(this);
+ });
+
+ // Call the second function for elements no longer matched
+ if ( this.fn2 && oEls.length > 0 )
+ $.each(oEls, function(i, el) {
+ if ( $.inArray(el, els) < 0 )
+ query.fn2.apply(el);
+ });
+ }
+ }
+};
+
+$.extend($.livequery, {
+ guid: 0,
+ queries: [],
+ queue: [],
+ running: false,
+ timeout: null,
+
+ checkQueue: function() {
+ if ( $.livequery.running && $.livequery.queue.length ) {
+ var length = $.livequery.queue.length;
+ // Run each Live Query currently in the queue
+ while ( length-- )
+ $.livequery.queries[ $.livequery.queue.shift() ].run();
+ }
+ },
+
+ pause: function() {
+ // Don't run anymore Live Queries until restarted
+ $.livequery.running = false;
+ },
+
+ play: function() {
+ // Restart Live Queries
+ $.livequery.running = true;
+ // Request a run of the Live Queries
+ $.livequery.run();
+ },
+
+ registerPlugin: function() {
+ $.each( arguments, function(i,n) {
+ // Short-circuit if the method doesn't exist
+ if (!$.fn[n]) return;
+
+ // Save a reference to the original method
+ var old = $.fn[n];
+
+ // Create a new method
+ $.fn[n] = function() {
+ // Call the original method
+ var r = old.apply(this, arguments);
+
+ // Request a run of the Live Queries
+ $.livequery.run();
+
+ // Return the original methods result
+ return r;
+ }
+ });
+ },
+
+ run: function(id) {
+ if (id != undefined) {
+ // Put the particular Live Query in the queue if it doesn't already exist
+ if ( $.inArray(id, $.livequery.queue) < 0 )
+ $.livequery.queue.push( id );
+ }
+ else
+ // Put each Live Query in the queue if it doesn't already exist
+ $.each( $.livequery.queries, function(id) {
+ if ( $.inArray(id, $.livequery.queue) < 0 )
+ $.livequery.queue.push( id );
+ });
+
+ // Clear timeout if it already exists
+ if ($.livequery.timeout) clearTimeout($.livequery.timeout);
+ // Create a timeout to check the queue and actually run the Live Queries
+ $.livequery.timeout = setTimeout($.livequery.checkQueue, 20);
+ },
+
+ stop: function(id) {
+ if (id != undefined)
+ // Stop are particular Live Query
+ $.livequery.queries[ id ].stop();
+ else
+ // Stop all Live Queries
+ $.each( $.livequery.queries, function(id) {
+ $.livequery.queries[ id ].stop();
+ });
+ }
+});
+
+// Register core DOM manipulation methods
+$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove');
+
+// Run Live Queries when the Document is ready
+$(function() { $.livequery.play(); });
+
+
+// Save a reference to the original init method
+var init = $.prototype.init;
+
+// Create a new init method that exposes two new properties: selector and context
+$.prototype.init = function(a,c) {
+ // Call the original init and save the result
+ var r = init.apply(this, arguments);
+
+ // Copy over properties if they exist already
+ if (a && a.selector)
+ r.context = a.context, r.selector = a.selector;
+
+ // Set properties
+ if ( typeof a == 'string' )
+ r.context = c || document, r.selector = a;
+
+ // Return the result
+ return r;
+};
+
+// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091)
+$.prototype.init.prototype = $.prototype;
+
+})(jQuery);
\ No newline at end of file