function popup(url, width, height, scrollbars)
{
	left = (screen.width / 2) - (width / 2);
	top = (screen.height / 2) - (height / 2);
	scrollbars = (scrollbars == 'no' ? scrollbars : 'yes');
	newWindow = window.open(url, 'name', 'height=' + height + ',width=' + width + ',top=' +top + ',left=' + left + ',scrollbars=' + scrollbars);
	if (window.focus) newWindow.focus();
	if (newWindow.opener == null) newWindow.opener = this;
	return false;
}

function openchat(oForm)
{
	popup('content/chat/chat.php?nick=' + oForm.nick.value, 640, 400, 'no');
	return false;
}

function openPlayer()
{
	var newWindow=window.open('http://www.crew.lu/player','player','height=245,width=505,top='+(screen.height/2-125)+',left='+(screen.width/2-250)+',scrollbars=no');
	//var newWindow=window.open('http://localhost/crew/player','player','height=245,width=505,top='+(screen.height/2-125)+',left='+(screen.width/2-250)+',scrollbars=no');
	if (window.focus) {newWindow.focus()}
	if (newWindow.opener == null) newWindow.opener = this;
	return false;
}

window.onload = function()
{
	if (!document.getElementById) return;

	// Table styling
	var i, j;

	var tables = document.getElementsByTagName('table');

	for (i = 0; i < tables.length; i++)
	{
		if (tables[i].className == 'alternateRows')
		{
			rows = tables[i].getElementsByTagName('tr');
			for (j = 0; j < rows.length; j++)
			{
				if (j % 2 == 0)
				{
					rows[j].setAttribute('className', 'even');
					rows[j].setAttribute('class', 'even');
				}
			}
		}

		if (tables[i].className == 'alternateCells')
		{
			rows = tables[i].getElementsByTagName('tr');
			var cellCounter = 0;
			for (j = 0; j < rows.length; j++)
			{
				cells = rows[j].getElementsByTagName('td');
				for (k = 0; k < cells.length; k++)
				{
					if (cellCounter % 2 == 0)
					{
						cells[k].setAttribute('className', 'even');
						cells[k].setAttribute('class', 'even');
					}
					cellCounter++;
				}
			}
		}
	}
}