jQuery.fn.extend({
	enterAction : function(block) {
		return $(this).each(function() {
			jQuery.enterAction.apply(this, [block]);
		});
	}
});

jQuery.enterAction = function(block) {
	last = null;
	$(this).keydown(function(e) {
		if (e.keyCode == 13 && last != 38 && last != 40) {
			block.apply(this);
			return false;
		}
		last = e.keyCode;
	});
};

