/*
 * 
 * @author Wouter De Loose
 * @website www.woutr.be
 * @version 1.0
 * 
 */
$.fn.required = function (str) {
	$(this).each(function() {
		var pos = $(this).position();
		var div = "<div class='requiredBox'>" + str + "</div>";
		var requiredStar = "<span class='requiredStar'>*</span>";
		
		$(this).after(requiredStar);
		$(this).after(div);
	
		var posLeft = pos.left + $(this).width();
		var posTop = pos.top;
	
		$(this).next().css({
			"top": posTop + "px",
			"left": posLeft + "px",
			"position": "absolute"
		});
	
		$(this).next().hide();
		$(this).focusout(function() {
			$(this).next().fadeOut("fast");
		});
		$(this).focusin(function() {
			$(this).next().fadeIn("fast");
		});
	})
}
