function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
var soundOn = true;
function toggleSound() {
	if (soundOn) {
		document.getElementById("soundDisp").innerHTML = "Sound Off";
		soundOn = false;
	} else {
		document.getElementById("soundDisp").innerHTML = "Sound On";
		soundOn = true;
	}
	return false;
}
function playSound(okToPlay, id) {
	var soundFile = document.getElementById(id);
	if (okToPlay && soundOn && (ie || soundFile.Play)) { 
		soundFile.Play(); hasPlayed = true; 
	}
}

function setHighScore() {
	var highscore = document.getElementById("highscore");
	var box = document.getElementById("box");
	var bodycontent = document.getElementById("bodycontent");
	highscore.style.top = findPosY(box) + 50;
	highscore.style.left = nn6 ? findPosX(bodycontent) + 250 - (highscore.width / 2): findPosX(bodycontent) + 50 - (highscore.width / 2);
	highscore.style.display = "block";
	highscore.style.zIndex = '3'; 
	getHighScores();
}
