jQuery.fn.dataset = function(name) {
	if (this.length == 0) {
		// no nodes, return
		return null;
	}
	if (this.length == 1) {
		// for a single node, return value
		if (this[0].dataset != undefined) {
			return this[0].dataset[name];
		}
		// fallback if dataset is not a member of the node
		return this.attr("data-"+name);
	}
	// multiple nodes, return dictionary from object id to value
	var values = {};
	this.each(function(o) {
		values[$(o).attr("id")] = $(o).dataset(name);
	});
	return values;
};

