

// Define some switchable titles
var titles= new Array("Never Mind The Bollocks Here's The Twaddle (...hang on a sec—we probably shouldn't use that one any more)","I Can't Believe It's Not A Tree... no! wait! The Twaddle!","This Wasn't A Twaddle... hang on, that can't be right...","Can you tell me how to get, how to get to The Twaddle?","The Twaddle, yeah, yeah, yeah, The Twaddle, yeah, yeah, yeah, The Twaddle, yeah, yeah, yeah, yeah!","Kids'll do anything for The Twaddle","We spent the evening unpacking books from boxes, you passed me up so as not to break The Twaddle","If you like a lot of chocolate on your biscuit, join The Twaddle","Netto—it's Scandinavian for The Twaddle","Does exactly what it says on The Twaddle","You see a painted sign by the side of the road that says 15 miles to The Twaddle!","I bet you wondered how I knew about your plans to make me blue with some other guy you knew before; we're two of a kind, you know I love you more; it took me by surprise, I must say, when I found out yesterday; oh, I heard it through The Twaddle, not much longer will you be mine.","Space—the final frontier; these are the voyages of the starship Twaddle, her five-year mission: to explore strange, new worlds; to seek out new life and new civilisations; to boldly go where no man has gone before.","The quick brown fox jumps over The Twaddle","The Twaddle wobbles but it won't fall down","We were at the beach, everybody had matching towels; somebody went under a dock and there they saw a rock; but it wasn't a rock—it was The Twaddle","Feels like I've been to every single disco all around; another night, another town, it's time to burn The Twaddle down","Who's house? The Twaddle's House! (Say what)","Now what you hear is not a test—I'm rapping to The Twaddle","The Twaddle will tear us apart, again");

// Pick one
var period = 86400000		// 24 hours
var x = new Date();
var x = Math.floor(x.getTime()/period);
do {x=x-titles.length} while (x>titles.length);
var title = titles[x-1];		// arrays start at number zero



// Define a function to switch the title
function switchtitle() {

// Find the content div and the existing title
var scontent = document.getElementById("s-content");
var spagetitle = document.getElementById("s-page-title");

// Create a text node containing the tagline
var text = document.createTextNode(title);

// Create the h2, id it, add text
var newtitle = document.createElement("h2");
newtitle.setAttribute("id", "s-page-title");
newtitle.appendChild(text);

// Insert the h2
scontent.replaceChild(newtitle, spagetitle)

}


// Once the document is loaded, call the function to insert the tagline
window.onload = switchtitle


