function update_div(what, where) {												// *What: The <div> tag we're updating. *Where: The data source.
	document.getElementById('loading').className = "loading-visible";			// Make the loading layer visible.
	var xmlhttp;
	var errormsgs = [															// Massive array for error messages. Will move this to file I/O later.
		"These are not the droids you're looking for.",
		"I swear, it was right here a minute ago!",
		"Now where did I put it?",
		"I'm going to blame you for that one.",
		"Now look at what you've done!",
		"On the internet, no one can hear you scream.",
		"A billion websites, and you had to pick this one.",
		"You're disappointed? Mom wanted us to be a doctor.",
		"This webpage packed its bags and moved to Toledo.",
		"We sent this page to NASA for testing.",
		"Your URL is an Unreliable Resource Locator.",
		"First crop circles and now this...Weird!",
		"You had better pull over and ask for directions.",
		"Great, now you've gone and done it. You've broken the Internet.Way to go!",
		"If true happiness can only be achieved through a state of nothingness, you're going down the right path.",
		"If at first you don't succeed, type, type again.",
		"Your lucky numbers for today: 4, 0, 4.",
		"Nothing to see here. Move along, buddy.",
		"This page has moved to California to find itself.",
		"The page you are looking for has spontaneously combusted.",
		"The page you requested is taking a coffee break.",
		"It only takes one wrong letter to hold back this page, not a nation of millions.",
		"We have t stop meeting like this. Seriously.",
		"That'll teach you to buy a \"good as new\" URL.",
		"Apparently, this page is not compatible with any browsers.",
		"Aliens must have abducted this page!",
		"It looks like the typing class your cat is taking is not 100% successful.",
		"OK, that's the last time we let you drive.",
		"If someone makes a webpage and gives the wrong URL, does it really exist?",
		"If you had a nickel for each time you hit an incorrect URL, you'd be 5 cents richer right now.",
		"Sometimes we like to get a little crazy and type in totally random URLs to see what happens. This is what happens.",
		"Hope you didn't pay too much for that URL.",
		"Some folks can see dead people - can you see dead pages?",
		"The dog ate your webpage. Yeah, that's it.",
		"Missing: One Home Page.",
		"'I remember when the internet only had a few pages, and they all worked' - 'Sure, Grampa...",
		"If you're reading this, it means this page is no more. It's probably not your fault.",
		"We didn't do it."
	];
	xmlhttp=new XMLHttpRequest();
	xmlhttp.onreadystatechange=function() {										// When request state changes
		if (xmlhttp.readyState==4) {											// When request is complete
			if(xmlhttp.status==200) {											// If loaded successfully
				document.getElementById(what).innerHTML=xmlhttp.responseText;	// Show loaded page data
			} else {															// Otherwise, Show us a 'Damnit, we stuffed up.' page.
				document.getElementById(what).innerHTML="<div class=\"heading\">Whoops!</div><div style=\"width: 100%; text-align: center\">" + errormsgs[Math.round((Math.random()*(errormsgs.length-1)))] + "<br /><br />But seriously, we can't find the page you're looking for. Rest assured, we'll have the problem fixed shortly.</div>" ;
			}
			document.getElementById('loading').className = "loading-invisible";	// Hide the loading layer again.
		}
	}
	xmlhttp.open("GET",where + "?t=" + Math.random(),true);						// Our HTTP request. the ?t=randnum is to prevent browser caching.
	xmlhttp.send();																// Send the request, then wait for the onreadystatechange.
}

