$.fn.form_helper = function(){
	return this.each(function(){
		$this = $(this);
		
		$('input', $this).keydown(function(event){
			if(event.keyCode == 13){
				$(this).parents('form').submit();
			}
		});
		
		$('a.button-submit', $this).click(function(event){
			event.preventDefault();
			$(this).parents('form').submit();
		})
		
	});
}

$(function(){
	$('form').form_helper();
})