var mainMenuBoxes = 5;
var pageToGo = new Array()
 pageToGo[0] = "./?fuerteventura.html"
 pageToGo[1] = "./?sport-auf-fuerteventura.html"
 pageToGo[2] = "./?reiseangebote-fuerteventura.html"
 pageToGo[3] = "./?fuerteventura-bilder.html"
 pageToGo[4] = "./?fuerteblog-lesen.html"
var NewContent		=  "<img class='menuactiveleft' src='graphics-main/link-active-ani.gif' width='8px' height='8px'>"
var NewContentSub =  "<img class='menuactivesub' src='graphics-main/link-active-sub-ani.gif' width='17px' height='8px'>"
var OneStar = 'fuerteventura'
var TwoStar = 'intro'
/*
//--- ENDE VARIABLENDEFINITION ---
*/
if (document.URL.indexOf("?") > -1)
{
	var GetPathParts = document.URL.replace(/.html/,"").split("?")
	//alert (GetPathParts)
	if(GetPathParts[1].indexOf("_") > -1 || GetPathParts[1].indexOf("--") > -1)
	{
		if(GetPathParts[1].indexOf("fuerteinfo-allgemein") > -1)
		{
		whatMenu = 0;
		}
		else
		{
		
		var SetIdToSeekFor = GetPathParts[1].replace(/_/,"--").split("--")
		var whatMenu = document.getElementById(SetIdToSeekFor[0]).parentNode.parentNode.id.replace(/menuBox-/,"")
		}
	}
	else
	{

	if (GetPathParts[1].indexOf("fuerteblog") > -1)
	{
	whatMenu = 4;
	}
	else{
		var whatMenu = document.getElementById(GetPathParts[1]).parentNode.parentNode.id.replace(/menuBox-/,"")
		if(whatMenu.indexOf("Omni") > -1 || whatMenu == "")
		{
whatMenu = 0;
}
}
}
}
else
{
	whatMenu = 0
}
menuCleanUp(whatMenu)
menuSwitcherOver(whatMenu)

if (document.URL.indexOf("?") > -1)
{
	var GetStarParts = document.URL.replace(/.html/,"").split("?")
	if(GetStarParts[1].indexOf("_") > -1 || GetStarParts[1].indexOf("--") > -1)
	{
		var SetStarsOneTwo = GetStarParts[1].replace(/_/,"--").split("--")
		setOneStar(SetStarsOneTwo[0])
		setTwoStar(SetStarsOneTwo[1],SetStarsOneTwo[2])
	}
	else
	{
		if (GetPathParts[1].indexOf("fuerteblog") > -1)
		{
			if (GetPathParts[1].indexOf("&c=") > -1)
			{
				var GetBlogCat = GetPathParts[1].split("&c=")
				var OneStar = "blogcat"+GetBlogCat[1]
				setOneStar(OneStar)
			}
			else
			{
				setOneStar('fuerteblog-lesen')
			}
		}
		else
		{
		setOneStar(GetStarParts[1])
		setTwoStar("intro")
		}
	}
}
else
{
	setOneStar(OneStar)
	setTwoStar(TwoStar)
}


function setOneStar(OneStar)
{
	OldContent = document.getElementById(OneStar).innerHTML
	document.getElementById(OneStar).innerHTML = NewContent+OldContent
	document.getElementById(OneStar).className = "selected"
}

function setTwoStar(TwoStar,MultiStar)
{	
	if(document.getElementById(TwoStar))
	{
		OldContent = document.getElementById(TwoStar).innerHTML
		document.getElementById(TwoStar).innerHTML = NewContentSub+OldContent
		document.getElementById(TwoStar).className = "selected"
		
	}	
	if(document.getElementById(TwoStar+"--"+MultiStar))
	{
		document.getElementById(TwoStar+"--"+MultiStar).className = "selected"
		document.getElementById(TwoStar+"--"+MultiStar).innerHTML = document.getElementById(TwoStar+"--"+MultiStar).innerHTML.replace(/-/,"&rarr;")
	}
	if(document.getElementById(TwoStar+"-multi"))
	{
		HelpStar = TwoStar.split("-")
		NewStar = TwoStar.substr(0,TwoStar.length-HelpStar[HelpStar.length-1].length)+'1'
		OldContent = document.getElementById(NewStar).innerHTML
		document.getElementById(NewStar).innerHTML = NewContentSub+OldContent
		document.getElementById(NewStar).className = "selected"
		document.getElementById(TwoStar+"-multi").className = "selected"
	}
}

function menuCleanUp(whatMenu)
	{
		for(i=0;i<mainMenuBoxes;i++)
			{
				document.getElementById("headBoxMenuButton-"+i).className = ""
				document.getElementById("menuBox-"+i).style.display = "none"
				document.getElementById("gimmick-"+i).style.display = "none"
			}
		document.getElementById("headBoxMenuButton-"+whatMenu).className = "buttonActive"
		document.getElementById("menuBox-"+whatMenu).style.display = "block"
		document.getElementById("gimmick-"+whatMenu).style.display = "block"
	}


function menuSwitcherOver(whatMenu)
	{
	document.getElementById("headBoxEyecatcherPicture").style.background = "url(graphics-main/head-eyecatcher-"+whatMenu+".jpg)"
	}


function swapPicture(whatINFO)
		{
		var pictureFolder = "fuerteventura-bilder/"
		var picturesNames = document.URL.replace(/.html/,"").split("?");
		var pictureName = picturesNames[1];
		buildPictureSource = pictureFolder+pictureName+"-"+whatINFO+".jpg"
		document.getElementById("picsub").innerHTML = infoNAME[whatINFO]
		document.getElementById("bigpic").src = buildPictureSource
		}
