function OpenGalerie(param)
{
	var w = window.open("/galerie.php?"+param, "Galerie", "width=650,height=680,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
	w.focus();
}

function OpenTicker(url, SpielID)
{
	var w = window.open(url+"?SpielID="+SpielID, "Ticker"+SpielID, "width=500,height=650,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
	w.focus();
}

function OpenChat()
{
	var w = window.open("/fanzone/chat/popup.php", "FCEFanChat", "width=800,height=650,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
	w.focus();
}

function OpenPopUp(url, name, w, h)
{
	var w = window.open(url, name, "width="+w+",height="+h+",menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
	w.focus();
}

function OpenPKTV()
{
	var w = window.open("/pk_tv/home.php", "PK_TV", "width=500,height=570,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
	w.focus();
}

function OpenShop()
{
	window.open("/shop2/catalog/default.php", "shop");
	/*
	var p = window.open("/popup/shop_weihnacht.html", "_blank", "width=400, height=400, resizable=yes,status=no,menubar=no,location=no,scrollbars=no,toolbar=no");
	p.focus();
	*/
}

/*
*
* Geburtstagsticker
*
*/
var GTicker = null;
var GTickerDiv = null;
var GTickerDivDummy = null;
var GTickerFred = null;

function initGTicker()
{
	GTicker = document.getElementById('GTicker');
	if (!GTicker)	return;
	
	var divs = GTicker.getElementsByTagName('div');
	if (divs.length < 2)	return;
	GTickerDiv = divs[0];
	GTickerDivDummy = divs[1];
	
	// der IE-Arsch kennt die Breite noch nicht - alle anderen schon ...
	if (GTicker.offsetWidth==0 || GTickerDiv.offsetWidth==0)	{
		setTimeout("initGTicker()", 50);
		return;
	}
	
	// in manchen Browsern sind abgeschnittene DIVs genauso gross wie das ElternDIV - dumme Sache
	if (GTickerDiv.offsetWidth >= GTicker.offsetWidth)	{
		GTickerDiv.style.left = GTicker.offsetWidth+"px";
		GTickerDivDummy.style.left = GTicker.offsetWidth+GTickerDiv.offsetWidth+"px";
		rollGTicker();
	}
	else	{
		GTickerDiv.style.display = "none";
		GTickerDiv = null;
	}
}

function rollGTicker()
{
	if (!GTickerDiv)	return;
	var off = parseInt(GTickerDiv.style.left)-1;
	if (off <= 0-GTickerDiv.offsetWidth)	{
		off = 0;
	}
	GTickerDiv.style.left = off+"px";
	GTickerDivDummy.style.left = off+GTickerDiv.offsetWidth+"px";
	GTickerFred = setTimeout("rollGTicker()", 30);
}

function stopGTicker()
{
	if (!GTickerFred)	return;
	clearTimeout(GTickerFred);
}
