messageTimer = setTimeout("x=2;", 0);
successTimer = setTimeout("x=2;", 0);
errorTimer = setTimeout("x=2;", 0);

function showMessageBox(message, timeout) {
	clearTimeout(messageTimer);
	if (!timeout) {
		timeout = 5000;
	}
	document.getElementById("msgbox").innerHTML = message;
	$("#msgbox").show("slow");
	messageTimer = setTimeout("hideMessageBox()", timeout);
}

function showSuccessBox(message, timeout) {
	clearTimeout(successTimer);
	if (!timeout) {
		timeout = 5000;
	}
	document.getElementById("succbox").innerHTML = message;
	$("#succbox").show("slow");
	successTimer = setTimeout("hideSuccessBox()", timeout);
}

function showErrorBox(message, timeout) {
	clearTimeout(errorTimer);
	if (!timeout) {
		timeout = 5000;
	}
	document.getElementById("errbox").innerHTML = message;
	$("#errbox").show("slow");
	errorTimer = setTimeout("hideErrorBox()", timeout);
}

function hideMessageBox(fast) {
	speed = "fast";
	if (!fast) {
		speed = "slow";
	}
	$("#msgbox").hide(speed);
}

function hideSuccessBox(fast) {
	speed = "fast";
	if (!fast) {
		speed = "slow";
	}
	$("#succbox").hide(speed);
}

function hideErrorBox(fast) {
	speed = "fast";
	if (!fast) {
		speed = "slow";
	}
	$("#errbox").hide(speed);
}
