$.fn.coolForm = function(options) {
	this.each(function() {
		$(this).find("input, textarea").each(init);
	});
	
	function init(i) {
		if ($(this).val() == $(this).attr("data-nette-empty-value")) {
			$(this).addClass("focusout");
		}
		$(this).focus(function() {
			$(this).addClass("focusin").removeClass("focusout");
			if ($(this).val() == $(this).attr("data-nette-empty-value")) {
				$(this).val("");
			}
		}).focusout(function() {
			$(this).removeClass("focusin");
			if (!$(this).val()) {
				$(this).val($(this).attr("data-nette-empty-value"));
			}
			if ($(this).val() == $(this).attr("data-nette-empty-value")) {
				$(this).addClass("focusout");
			}
		});
	}
}
