

function replaceMenu ()
{
	if(document.getElementById('leftframe'))
	{
		links = document.getElementById('leftframe').getElementsByTagName("a");
		
		for(i=0;i<links.length;i++)
		{
			if(links[i].className == "main")
			{
				width = 180;
				height = 18;
				if(links[i].parentNode.className == "active")
				{
					color = 'ffffff';
					bgcolor = '707173';
				}
				else
				{
					color = '5879a4';
					bgcolor = 'f0f1f1';
				}
				font = 'TheSans-B5Plain.ttf';
				size = '12.1';
				
				myValue = links[i].innerHTML.toUpperCase();
				myValue = URLEncode(myValue);
				myFlash = ('<img src="/extensions/php_to_img/output.php?text=' + myValue + '&width=' + width + '&height=' + height + '&color=' + color + '&font=' + font + '&size=' + size + '&bgcolor=' + bgcolor + '" />');
			
				links[i].innerHTML = myFlash;
			}
		}
	}
	
	if(document.getElementById('portal'))
	{
		links = document.getElementById('menu').getElementsByTagName("a");
		
		for(i=0;i<links.length;i++)
		{
			if(links[i].className == "main")
			{
				width = 180;
				height = 18;
				color = 'ffffff';
				bgcolor = '7e8086';
				font = 'TheSans-B5Plain.ttf';
				size = '10.1';
				
				myValue = links[i].innerHTML.toUpperCase();
				myValue = URLEncode(myValue);
				myFlash = ('<img src="/extensions/php_to_img/output.php?text=' + myValue + '&width=' + width + '&height=' + height + '&color=' + color + '&font=' + font + '&size=' + size + '&bgcolor=' + bgcolor + '" />');
			
				links[i].innerHTML = myFlash;
			}
		}
	}
}

var aktiv = null;

function addHoverEffectMenu ()
{
	if(document.getElementById('leftframe'))
	{
		lis = document.getElementById('leftframe').getElementsByTagName("li");
		
		for(i=0;i<lis.length;i++)
		{
			if(lis[i].className == "out")
			{
				lis[i].onmouseover = function ()
				{
					unHoverAllElements();
					this.className = "over";
					this.style.position = "relative";
					
					if(this.getElementsByTagName("ul").length > 0)
					{
						document.getElementById('hovermenu').innerHTML = '<ul>' + this.getElementsByTagName("ul")[0].innerHTML + '</ul>';
						document.getElementById('hovermenu').style.top = this.offsetTop+'px';
						document.getElementById('hovermenu').style.display = 'block';
						//this.getElementsByTagName("ul")[0].style.top = this.offsetTop+'px';
					}
					else
					{
						document.getElementById('hovermenu').style.display = 'none';
					}
					this.style.position = "";
				}
				
				lis[i].onmouseout = function ()
				{
					//this.className = "out";
					aktiv = window.setInterval("unHoverAllElements()",200);
				}
			}
		}
	}
}


function addHoverMenuActions ()
{
	if(document.getElementById("hovermenu"))
	{
		document.getElementById("hovermenu").onmouseover = function ()
		{
			window.clearInterval(aktiv);
		}
		
		document.getElementById("hovermenu").onmouseout = function ()
		{
			aktiv = window.setInterval("unHoverAllElements()",200);
		}
	}
}

function unHoverAllElements ()
{
	window.clearInterval(aktiv);
	lis = document.getElementById('leftframe').getElementsByTagName("li");
	for(i=0;i<lis.length;i++)
	{
		if(lis[i].className == "over")
		{
			lis[i].className = "out";
		}
	}
	document.getElementById('hovermenu').style.display = 'none';
}


function inittopnavigation ()
{
	navelements = document.getElementById("top").getElementsByTagName("img");
	
	for(i=0;i<navelements.length;i++)
	{
		if(navelements[i].getAttribute("hover"))
		{			
			if(navelements[i].parentNode.parentNode.className == "middle")
			{
				// Saisonnavigation
				if(document.getElementById('saisonoverlay_winter'))
				{
					navelements[i].onmouseover = function ()
					{
						this.src = this.getAttribute("hover");
						document.getElementById('saisonoverlay_' + this.className).style.display = "block";
					}
					
					navelements[i].onmouseout = function ()
					{
						this.src = this.getAttribute("normal");
						document.getElementById('saisonoverlay_' + this.className).style.display = "none";
					}
				}
			}
			else
			{
				// Normale Navigation
				navelements[i].onmouseover = function ()
				{
					this.src = this.getAttribute("hover");
				}
				
				navelements[i].onmouseout = function ()
				{
					this.src = this.getAttribute("normal");
				}
			}
		}
	}
}



function goto (url)
{
	window.location.href=url;
}

