Is it possible to run this "indefinitely", without causing stack overflow or running out of memory?

function eternal(){
    var time = recalculateTime();
    doSomething();
    setTimeout(eternal,time);
}

setTimeout(eternal,200000);


I'm not using setInterval, because the triggering time is variable.


Question: What are lightbox / modal window UI best practices for viewing full-sized images in a gallery?
Answer: The modal image roll is very nice and is used on bigger social media sites, such as Facebook and Google+. So stick to it, but please do not omit the close button. It makes users confused and we wouldn't want that. One idea to use is Facebook's implementation, where you have the [X] fully working, but on hover user get a clue: use Esc to close! I think this is splendid design telling the users there are other ways and you do not have to grab your mouse to close the image: