window.onload = function init() {
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == 'label')
			x[i].onclick = clickNav;
	}
	closeNav();

	setNav(window.location,'currentPage');
}

function closeNav()
{
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == 'content')
			x[i].style.display = 'none';
	}
}

function clickNav(e)
{
	closeNav();
	if (!e) var e = window.event;
	if (e.target) var tg = e.target;
	else if (e.srcElement) var tg = e.srcElement;
	while (tg.nodeName != 'DIV') // Safari GRRRRRRRRRR
		tg = tg.parentNode;
	var nextSib = tg.nextSibling;
	while (nextSib.nodeType != 1)
		nextSib = nextSib.nextSibling;
	var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';
	nextSib.style.display = nextSibStatus;
}
function setNav(page,newID)
{
	var x = document.getElementsByTagName('a');
	var i;
	for (i=0;i<x.length;i++)
	{
		if (x[i].className == 'menu_l')
		{
			if (x[i].href == page)
			{
				x[i].id = newID;
				break;
			}
		}
	}
	if (i < x.length && newID == 'currentPage')
	{
		var parDiv = x[i];
		while (parDiv.parentNode.tagName == 'DIV')
		{
			parDiv = parDiv.parentNode;
			parDiv.style.display = 'block';
		}
	}
}

function popup(url)
{
		name = "start";
		width = screen.width-100;
		height = screen.height-150;

	window.open(url + '&screenwidth=' + screen.width + '&screenheight=' + screen.height,'blank', 'width=' + width + ',height=' + height + ',left=50,top=25, resizable = yes, scrollbars = yes');

}