//configure delay in miliseconds between each message (default: 2 seconds)
var shortintervals = 2000;
var mediumintervals = 4000
var longintervals = 6000;

//configure messages to be displayed
var splashmessage=new Array();
var openingtags = '<font face="Tahoma,Arial" size="2">';
splashmessage[0] = "As you step outside into the elven city, you hear a low rumble in the distance.";
splashmessage[1] = "Almost unconsciously, you gaze to the east.";
splashmessage[2] = "A black cloud, darker than any you have ever seen, looms over the horizon, casting a shadow almost as black as itself.";
splashmessage[3] = "The noon shadows melt into one, and day becomes indistinguishable from night.";
splashmessage[4] = "";
splashmessage[5] = "The Darkest Day is upon you.";
splashmessage[6] = "";
splashmessage[7] = "<P>As you step outside into the elven city, you hear a low rumble in the distance.  Almost unconsciously, you gaze to the east.  A black cloud, darker than any you have ever seen, looms over the horizon, casting a shadow almost as black as itself.  The noon shadows melt into one, and day becomes indistinguishable from night.</P><P>The Darkest Day is upon you.</P>";
var closingtags = '</font>';

var i = 0;
var waitinterval = 0;

function displaysplash_ie(){
	if (i == 0 || i == 2 || i == 3 || i == 5){
		waitinterval = longintervals;
	}else if(i == 4 || i == 6){
		waitinterval = shortintervals;
	}else{
		waitinterval = mediumintervals;
	}

	if (i < splashmessage.length){
		sc_ie.style.visibility = "hidden";
		sc_ie.innerHTML = '<b><center>' + openingtags + splashmessage[i] + closingtags + '</center></b>';
		sc_ie.style.top = 180; //document.body.scrollTop + (document.body.clientHeight / 2) - (sc_ie.offsetHeight / 2) - 100;
		sc_ie.style.visibility = "visible";
		i++;
	}else{
		return;
	}

	setTimeout("displaysplash_ie()", waitinterval);
}

function displaysplash_ns(){
	if (i == 0 || i == 2 || i == 3 || i == 5){
		waitinterval = longintervals;
	}else if(i == 4 || i == 6){
		waitinterval = shortintervals;
	}else{
		waitinterval = mediumintervals;
	}

	if (i < splashmessage.length){
		sc_ns.visibility = "hide";
		sc_ns.document.write('<b><center>'+openingtags+splashmessage[i]+closingtags+'</center></b>');
		sc_ns.document.close();
		
		sc_ns.left = pageXOffset + (window.innerWidth / 2) - (sc_ns.document.width / 2);
		sc_ns.top = 180; //pageYOffset + (window.innerHeight / 2) - (sc_ns.document.height / 2);

		sc_ns.visibility = "show";
		i++;
	}else{
		return;
	}

	setTimeout("displaysplash_ns()", waitinterval);
}

function positionsplashcontainer(){
	if (document.all){
		sc_ie = document.all.splashcontainer
		sc_ie.style.left = document.body.scrollLeft + (document.body.clientWidth / 2) - (sc_ie.offsetWidth / 2) + 63;
		sc_ie.style.top = 180; //document.body.scrollTop + (document.body.clientHeight / 2) - (sc_ie.offsetHeight / 2);
		displaysplash_ie();
	}else if (document.layers){
		sc_ns = document.splashcontainerns;
		sc_ns.left = pageXOffset + (window.innerWidth / 2) - (sc_ns.document.width / 2) + 63;
		sc_ns.top = 180; //pageYOffset + (window.innerHeight / 2) - (sc_ns.document.height / 2);
		sc_ns.visibility = "show";
		displaysplash_ns();
	}else{
		
	}
}
window.onload = positionsplashcontainer
