jQuery.fn.sort= function(sortfunction) {
	var sorted = [];
	this.each(function() {
		sorted[sorted.length] = this;
	});
	if (sortfunction != undefined) {
		sorted.sort(sortfunction);
	} else {
		sorted.sort();
	}
	return this.pushStack(sorted);
};