var colorCode = 0;

function DrawButton(buttonText, linkAdress, selectorLabel)
{
  var classstyle;

  if(selectorLabel == buttonText)
  {
    classstyle = "curButton";
  }
  else
  {
    classstyle = "naviButton";
  }

  document.write('<input type="button" onclick="Redirect(\'' + linkAdress + '\');" class="' + classstyle + '" value="' + buttonText + '" /><br />');
}

function DrawWebshop(buttonText, linkAdress)
{
  document.write('<input type="button" id="butWebshop" onclick="RedirectA(\'' + linkAdress + '\');" class="webButton" value="' + buttonText + '" /><br />');
}

function DrawBar(selectorLabel)
{
  setTimeout("changeColor()", 500);

  DrawButton("Home", "index.htm", selectorLabel);
  DrawButton("Kontakt", "Kontakt.htm", selectorLabel);
  DrawButton("Beschriftungen", "Beschriftung.htm", selectorLabel);
  DrawButton("Schilder", "Schilder.htm", selectorLabel);
  DrawButton("Aufkleber", "Aufkleber.htm", selectorLabel);
  DrawButton("Tribals", "Tribals.htm", selectorLabel);
  DrawButton("Dekore", "Dekore.htm", selectorLabel);
  DrawButton("Schablonen", "Schablonen.htm", selectorLabel);
  DrawButton("Textilien", "Textilien.htm", selectorLabel);
  DrawButton("Folienfarben", "Folienfarben.htm", selectorLabel);
  DrawButton("Impressum", "Impressum.htm", selectorLabel);
  document.write("</div>");
  document.write("<hr class='spaceline' />");
  document.write("<div class='navibar' style='padding-top: 0px;'>");
  DrawWebshop("Web Shop", "http://www.shop.creativcut.de");
}

function Redirect(adress)
{
  window.location = adress;
}

function RedirectA(adress)
{
  window.location.href = adress;
}

function changeColor()
{
	if(colorCode == 0)
	{
		document.getElementById("butWebshop").style.color = "black";
	}
	else if (colorCode == 1)
	{
		document.getElementById("butWebshop").style.color = "white";
	}
	else if (colorCode == 2)
	{
		document.getElementById("butWebshop").style.color = "black";
	}
	else
	{
		document.getElementById("butWebshop").style.color = "white";
	}

	colorCode++;

	if(colorCode == 4)
	{
		colorCode = 0;
	}

	setTimeout("changeColor()", 500);
}
