// Included on all pages

soundManager.url = 'http://oneclickwifi.net/javascript/sm/';

soundManager.onload = function() {
	soundManager.createSound({
		id: 'whiteboxSound',
		url: 'http://oneclickwifi.net/whitebox/wiisound.mp3',
		volume: 25
	});
	soundManager.createSound({
		id: 'nggyu',
		url: 'http://oneclickwifi.net/whitebox/nggyu.mp3'
	});
	soundManager.createSound({
		id: 'tw',
		url: 'http://oneclickwifi.net/whitebox/tw.mp3'
	});
}

function toggleOverlay(io)
{
	if (io) document.getElementById("overlay").style.display = "block";
	else document.getElementById("overlay").style.display = "none";
}

function getCookie(cookie)
{
	cookie = document.cookie.match ( '(^|;) ?' + cookie + '=([^;]*)(;|$)' );

	if (cookie)	return (unescape(cookie[2]));
	else		return null;
}

function escapePlus(input)
{	// Alias
	return encodeURIComponent(input);
}

function findPos(obj)
{
	var curleft = curtop = 0;
	
	if (obj.offsetParent)
	{
		do
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
		while (obj = obj.offsetParent);
		return [curleft,curtop];
	}
}