var perc_loaded=0;
var	splashref;
var timer = new Object;

function splashstart() {
	splash_pos();
}

function splash_pos() {
	splashref = document.getElementById("skullsplitters_bg");
	var the_height = get_browser_height();
	var the_offset = -160;
	var the_center = 350;
	var the_loc = parseInt(the_height/2) + the_offset;
	if (the_loc < 50) {the_loc = 50;}
	//DBug.innerHTML = the_height;
	splashref.style.top = the_loc+"px";
	//splash.style.top = the_loc;
	timer.splash = window.setTimeout("splash_pos()", 100);
}

function check_browser_width()
{
	var the_width = get_browser_width();
	if (the_width == 0)	{ return 2; } //unknown
	if (the_width < 1000)	{ return 0; } //too small
	return 1; //good
};

function get_browser_width()
{
	if (window.innerWidth)
	{
		return window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth != 0)
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		return document.body.clientWidth;
	}
	
	return 0;
};

function get_browser_height()
{
	if (window.innerHeight)
	{
		return window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight != 0)
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		return document.body.clientHeight;
	}
	
	return 0;
};
