Do you have code for your popup already (like a DIV with some styling)?
Let's assume you have a DIV with ID "popup" and style="display: none;". Then you need two functions. The following code uses jQuery
Code:
var certainTimeInSec = 5;
function showPopup() {
$('#popup').fadeIn(1000);
window.setTimeout(hidePopup, certainTimeInSec * 1000);
}
function hidePopup() {
$('#popup').fadeOut(1000);
}
$(function() {
window.setTimeout(showPopup, certainTimeInSec * 1000);
});