$.fn.displayThenHide = function(text, dontVanish) { 
	if (typeof dontVanish == "undefined")
		dontVanish  = false;
		
	$(this).html(text);
	$(this).show();
	$(this).css('opacity', '0');
	
	if(dontVanish){
			$(this).stop(true, true).fadeTo(400, 1);
	}
	else{
		$(this).stop(true, true).fadeTo(400, 1).delay(4000).fadeTo(1000, 0);
	}
    return true; 
}

		
function showResult(spanId, text, isOk, dontVanish){
	if (typeof isOk == "undefined")
		isOk = false;
	if (typeof dontVanish == "undefined")
		dontVanish  = false;
	
	$('#'+spanId).displayThenHide(text, dontVanish);


	if(isOk)
		$('#'+spanId).css('background', '#7d9e35');
	else
		$('#'+spanId).css('background', '#a94928');
		
}

