var theTimeoutID = 0;
var rollovers = false;
var isFresh = false;
var wasHideCalled = false;

function showExcerpt(thestr) {
	//alert("Caught showExcerpt: "+thestr);
	$("#excerpt_content").html(thestr);
	if($("#excerpt").css("display") == "none") {
		$("#excerpt").fadeIn("slow");
		isFresh = true;
	}
	if(!rollovers) {
		$("#excerpt_content").hover(function(){
			clearTimeout(theTimeoutID);
			theTimeoutID = 0;
		},function(){
			if(!wasHideCalled) hideExcerpt();
		});
		rollovers = true;
	}
}

function rollOff() {
	if(isFresh) {
		isFresh = false;
		theTimeoutID = setTimeout("hideExcerpt()",1000);
	}
}

function hideExcerpt() {
	//alert("Caught hideExcerpt");
	wasHideCalled = true;
	$("#excerpt").fadeOut("slow");
	theTimeoutID = setTimeout("cleanup()",1000);
	excerptFetched = true;
}

function cleanup() {
	wasHideCalled = false;
	//excerptFetched = true;
}

