/**
 * Ajax.Request.abort
 * extend the prototype.js Ajax.Request object so that it supports an abort method
 */
 Ajax.Request.addMethods({
		abort: function(){
			// avoid MSIE/Mozilla calling other event handlers when aborted 
			this.transport.onreadystatechange = Prototype.emptyFunction;
			 //now abort the request
			this.transport.abort(); 
			// update the request counter
			Ajax.activeRequestCount--;
			
			var response = new Ajax.Response(this);
			//call onAbort listener, if existent
			(this.options.onAbort || Prototype.emptyFunction)(response, response.headerJSON); 
		},
		softabort: function(){
			// avoid MSIE/Mozilla calling other event handlers when aborted 
			this.transport.onreadystatechange = Prototype.emptyFunction;
			var response = new Ajax.Response(this);
			//call onAbort listener, if existent
			(this.options.onAbort || Prototype.emptyFunction)(response, response.headerJSON); 
		}
	});
 
// /**
//  * Prioritizable is a sortable with extended options.
//  * Extend the prototype.js Sortable object so that it implements priorities better.
//  */
// var Prioritizable = {
//	    create: function(element) {
//	        options = Object.extend(arguments[1] || {}, {
//		        onChange: Prioritizable.onChange,
//		        onUpdate: Prioritizable.onUpdate
//		    });
//	    
//	        Sortable.create(element, options);
//	    },
//	    
//	    destroy: function(element) {
//	        Sortable.destroy(element);
//	    },
//	    
//	    onChange: function(item) {
//	        Sortable.options(item)._item = item;
//	    },
//	    
//	    onUpdate: function(element) {
//	        options = Sortable.options(element);
//	        item = options._item;
//	        options._item = null;
//	        
//	        sibling = item.previous();
//	        if (other) {
//	            position = "higher";
//	        } else {
//	            sibling = item.next();
//	            position = "lower"
//	        }
//	        
//	        options.onUpdate(item, position, sibling, element);
//	    },
//
//	    /*add: function(element) {
//	    	Sortable.add(element);
//	    }*/
//	};
