function shakeError(index,errorSet,direction) {
	
	if ($(errorSet).length<=index) {
		return false;
	}
	
	var eItem = $(errorSet).eq(index);
	var tPosition = $(eItem).position();
	
	if (direction && direction == "up") {
		$(eItem).animate(
				{
					top: tPosition.top+10
				},
				300,
				'swing',
				function() { 
					$(this).animate(
							{
								top: tPosition.top-5
							},
							400,
							'swing',
							function() { 
								$(this).animate(
										{
											top: tPosition.top
										},
										200,
										'swing', 
										function() { shakeError(index+1,errorSet,'up'); }
								); 
							}
					); 
				}
		);
	} else {
		$(eItem).animate(
				{
					left: tPosition.left+10
				},
				300,
				'swing',
				function() { 
					$(this).animate(
							{
								left: tPosition.left-5
							},
							400,
							'swing',
							function() { 
								$(this).animate(
										{
											left: tPosition.left
										},
										200,
										'swing', 
										function() { shakeError(index+1,errorSet); }
								); 
							}
					); 
				}
		);
	}
}