var menus;
var padding = 0;
var help = 1;
function menu(name, style, href)
{
	this.name = name;
	this.style = style;
	this.href = href;
	this.addHome = "true";
}

function menu(name, style, href, addHome)
{
	this.name = name;
	this.style = style;
	this.href = href;
	this.addHome = addHome;
}

function initMenu()
{
	menus = new Array();
	index = 0;
	malarstwo1="malarstwo/badanie";//pierwszy w malarstwie
	archiwum1="malarstwo/alfabet";//pierwszy w archiwum
	
	if (archiwum == 0)
	{
  	  if (english == 1)
	  {
		menus[index++] = new menu("Painting", "bigMenu", "");
		menus[index++] = new menu("miniatures", "smallMenu", "malarstwo/miniatura/index_en.html");
		menus[index++] = new menu("portraits", "smallMenu", "malarstwo/portrety/index_en.html");
		menus[index++] = new menu("hair", "smallMenu", "malarstwo/wlosy/index_en.html");
		menus[index++] = new menu("landscapes", "smallMenu", "malarstwo/krajobrazy/index_en.html");
		menus[index++] = new menu("research&nbsp;of&nbsp;heart", "smallMenu", "malarstwo/badanie/index_en.html");
		menus[index++] = new menu("art&nbsp;and&nbsp;heart", "smallMenu", "malarstwo/artandheart/index_en.html");
		//menus[index++] = new menu("meetings", "smallMenu", "malarstwo/spotkania/index_en.html");
		menus[index++] = new menu("figures", "smallMenu", "malarstwo/postacie/index_en.html");
		//menus[index++] = new menu("flowers", "smallMenu", "malarstwo/kwiaty/index_en.html");
		menus[index++] = new menu("souvenirs", "smallMenu", "malarstwo/pamiatki/index_en.html");
		menus[index++] = new menu("dreams", "smallMenu", "malarstwo/sny/index_en.html");
		//menus[index++] = new menu("paintings", "smallMenu", "malarstwo/obrazy/index_en.html");
		menus[index++] = new menu("the&nbsp;circus&nbsp;and&nbsp;games", "smallMenu", "malarstwo/cyrk/index_en.html");
		//menus[index++] = new menu("games", "smallMenu", "malarstwo/gry/index_en.html");
		menus[index++] = new menu("video&#8209;installations", "smallMenu", "malarstwo/wideo/index_en.html");
		
		menus[index++] = new menu("Archive<br>1997-2003", "bigMenu", archiwum1 + "/index_en.html");

		menus[index++] = new menu("Biography", "bigMenu", "zyciorys_en.html");
		menus[index++] = new menu("Text", "bigMenu", "text_en.html");
		menus[index++] = new menu("e-mail", "bigMenu", "mailto:wielekmandrela@poczta.onet.pl", "false");
		menus[index++] = new menu("links", "bigMenu", "links.html");
	  }
	  else
	  {
	  	menus[index++] = new menu("Malarstwo", "bigMenu", "");
		menus[index++] = new menu("miniatury", "smallMenu", "malarstwo/miniatura/index.html");
		menus[index++] = new menu("portrety", "smallMenu", "malarstwo/portrety/index.html");
		menus[index++] = new menu("włosy", "smallMenu", "malarstwo/wlosy/index.html");
		menus[index++] = new menu("krajobrazy", "smallMenu", "malarstwo/krajobrazy/index.html");
		menus[index++] = new menu("badanie&nbsp;serca", "smallMenu", "malarstwo/badanie/index.html");
		menus[index++] = new menu("art&nbsp;and&nbsp;heart", "smallMenu", "malarstwo/artandheart/index.html");
		//menus[index++] = new menu("spotkania", "smallMenu", "malarstwo/spotkania/index.html");
		menus[index++] = new menu("postacie", "smallMenu", "malarstwo/postacie/index.html");
		//menus[index++] = new menu("kwiaty", "smallMenu", "malarstwo/kwiaty/index.html");
		menus[index++] = new menu("pamiątki", "smallMenu", "malarstwo/pamiatki/index.html");
		menus[index++] = new menu("sny", "smallMenu", "malarstwo/sny/index.html");
		//menus[index++] = new menu("obrazy", "smallMenu", "malarstwo/obrazy/index.html");
		menus[index++] = new menu("cyrk&nbsp;i&nbsp;gry", "smallMenu", "malarstwo/cyrk/index.html");
		//menus[index++] = new menu("gry", "smallMenu", "malarstwo/gry/index.html");
		menus[index++] = new menu("video&#8209;instalacje", "smallMenu", "malarstwo/wideo/index.html");

		menus[index++] = new menu("Archiwum<br>1997-2003", "bigMenu", archiwum1 + "/index.html");

		menus[index++] = new menu("Życiorys", "bigMenu", "zyciorys.html");
		menus[index++] = new menu("Teksty", "bigMenu", "text.html");
		menus[index++] = new menu("e-mail", "bigMenu", "mailto:wielekmandrela@poczta.onet.pl", "false");
		menus[index++] = new menu("linki", "bigMenu", "links.html");

	  }
	}
	else if (archiwum == 1)
	{
  	  if (english == 1)
	  {
		menus[index++] = new menu("Painting", "bigMenu", malarstwo1 + "/index_en.html");
		menus[index++] = new menu("Archive", "bigMenu", "");
		menus[index++] = new menu("the&nbsp;alphabet", "smallMenu", "malarstwo/alfabet/index_en.html");
		menus[index++] = new menu("numbers", "smallMenu", "malarstwo/cyfry/index_en.html");
		menus[index++] = new menu("the&nbsp;sun", "smallMenu", "malarstwo/slonce/index_en.html");
		menus[index++] = new menu("alchemy", "smallMenu", "malarstwo/alchemia/index_en.html");
//		menus[index++] = new menu("the&nbsp;diploma", "smallMenu", "malarstwo/dyplom/index_en.html");
//		menus[index++] = new menu("heads", "smallMenu", "malarstwo/glowy/index_en.html");
//		menus[index++] = new menu("others", "smallMenu", "malarstwo/inne/index_en.html");
//		menus[index++] = new menu("2000", "smallMenu", "malarstwo/2000/index_en.html");
//		menus[index++] = new menu("1999", "smallMenu", "malarstwo/1999/index_en.html");
//		menus[index++] = new menu("1998", "smallMenu", "malarstwo/1998/index_en.html");

		menus[index++] = new menu("Biography", "bigMenu", "zyciorys_en.html");
		menus[index++] = new menu("e-mail", "bigMenu", "mailto:wielekmandrela@poczta.onet.pl", "false");
		menus[index++] = new menu("links", "bigMenu", "links.html");
      }
      else
      {
		menus[index++] = new menu("Malarstwo", "bigMenu", malarstwo1 + "/index.html");
	  	menus[index++] = new menu("Archiwum", "bigMenu", "");
		menus[index++] = new menu("alfabet", "smallMenu", "malarstwo/alfabet/index.html");
		menus[index++] = new menu("cyfry", "smallMenu", "malarstwo/cyfry/index.html");
		menus[index++] = new menu("słońce", "smallMenu", "malarstwo/slonce/index.html");
		menus[index++] = new menu("alchemia", "smallMenu", "malarstwo/alchemia/index.html");
//		menus[index++] = new menu("dyplom", "smallMenu", "malarstwo/dyplom/index.html");
//		menus[index++] = new menu("głowy", "smallMenu", "malarstwo/glowy/index.html");
//		menus[index++] = new menu("inne", "smallMenu", "malarstwo/inne/index.html");
//		menus[index++] = new menu("2000", "smallMenu", "malarstwo/2000/index.html");
//		menus[index++] = new menu("1999", "smallMenu", "malarstwo/1999/index.html");
//		menus[index++] = new menu("1998", "smallMenu", "malarstwo/1998/index.html");
      
		menus[index++] = new menu("Życiorys", "bigMenu", "zyciorys.html");
		menus[index++] = new menu("e-mail", "bigMenu", "mailto:wielekmandrela@poczta.onet.pl", "false");
		menus[index++] = new menu("linki", "bigMenu", "links.html");
      
      }	
	}
}

function printItem(item)
{
	if ((item.href == "") || (item.name == menuItem))
	{
		document.write("<b>");
	}
	
	document.write("<a ");
	if ((item.href == "") || (item.name == menuItem))
	{}
	else
	{
		if (item.addHome == "false")
		{
			document.write("href=\"" + item.href + "\" ");
		}
		else
		{
			document.write("href=\"" + home + item.href + "\" ");
		}
	}
	document.write("class=\"" + item.style + "\" ");
	document.write(">");
	document.write(item.name + "</a>");
	if ((item.href == "") || (item.name == menuItem))
	{
		document.write("</b>");
	}
}

function printBigMenu(index)
{
	document.write("<tr>");
	document.write("<td width=\"0%\" height=\"0%\">");
	printItem(menus[index]);
	document.write("</td><td>&nbsp;</td></tr>");
	document.write("<tr><td valign=\"top\"><table width=\"100%\" border=\"0\" celpadding=\"0\" cellspacing=\"0\"><tr><td width=\"100%\" height=\"5\" background=\"" + home + "images/line.jpg\"></td></tr></table></td>");
	document.write("<td>");
	if ((index < menus.length - 1) && (menus[index + 1].style == "smallMenu"))
	{
		document.write("<table width=\"0%\" height=\"0%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		document.write("<tr><td width=\"4\" background=\"" + home + "images/vline.jpg\">&nbsp;</td>");
		document.write("<td>");
		while ((index < menus.length - 1) && (menus[index + 1].style == "smallMenu"))
		{
			index++;
			printItem(menus[index]);
			document.write("<br>");
		}
		document.write("</td>");
		document.write("</tr></table>");
	}
	document.write("</td>");
	document.write("</tr>");
	
}

function printMenu()
{
	initMenu();
	//menu padding
	document.write("<a href=\"index.html\"><img src=\"" + home + "images/polish.gif\" alt=\"Polski\" border=0></a>");
	document.write("&nbsp;&nbsp;&nbsp;");
	document.write("<a href=\"index_en.html\"><img src=\"" + home + "images/english.gif\" alt=\"English\" border=0></a>");
	if (help == 1)
	{
		//document.write("<br><a class=\"smallmenu\" href=\"" + home + "index.html\">");
		//if (english == 1)
		//	document.write("&lt;&lt;&nbsp;Main&nbsp;page");
		//else
		//	document.write("&lt;&lt;&nbsp;Strona&nbsp;główna");
		//document.write("</a>");
	        //document.write("<table width=\"0%\" height=\"10\"><tr><td width=\"100%\" height=\"10\">&nbsp;</td></tr></table>");
	}
	else
	{
	      document.write("<table width=\"0%\" height=\"" + padding + "\"><tr><td width=\"100%\" height=\"100\">&nbsp;</td></tr></table>");
	}
	for (i = 0; i < menus.length; i++)
	{
		document.write("<table width=\"0%\" height=\"0%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		if (menus[i].style == "bigMenu")
		{
			 printBigMenu(i);
		}
		document.write("</table>");
	}
}

function printLeft()
{
	
/*	
	if (english == 1)
	{
		document.write("<a id=\"prevbutton\" class=\"middletextstyle\" href=\"javascript:poprzedni()\">&lt;&lt;&nbsp;prev&nbsp;</a>");
	}
	else
	{
		document.write("<a id=\"prevbutton\" class=\"middletextstyle\" href=\"javascript:poprzedni()\">&lt;&lt;&nbsp;poprzedni&nbsp;</a>");
	}
*/			
}

function printRight()
{
	
	/*
	if (english == 1)
	{
		document.write("<a id=\"nextbutton\" class=\"middletextstyle\" href=\"javascript:nastepny()\">&nbsp;next&nbsp;&gt;&gt;</a>");
	}
	else
	{
		document.write("<a id=\"nextbutton\" class=\"middletextstyle\" href=\"javascript:nastepny()\">&nbsp;następny&nbsp;&gt;&gt;</a>");
	}
	*/		
}

function printMiddle()
{
	document.write("<a id=\"middletext\" class=\"middletextstyle\" name=\"middletext\"></a>");
}

function printButtons()
{
	
	document.write("<table width=\"100%\" height=\"100%\" border=\"0\">");
	document.write("<tr height=\"100%\"><td height=\"100%\"><br></td></tr>");
	document.write("<tr height=\"0%\"><td width=\"100%\" height=\"0%\" align=\"center\">");
	document.write("<a class=\"middletextstyle\" name=\"currentIndex\">&nbsp;</a>&nbsp;/&nbsp;<a class=\"middletextstyle\" name=\"maxIndex\">&nbsp;</a>");
	document.write("</td></tr>");
	/*
	document.write("<tr height=\"0%\"><td width=\"100%\" height=\"0%\" align=\"center\">");
        if (english == 1)
        {
        	document.write("<a class=\"middletextstyle\" href=\"" + home + "index_en.html\">");
		document.write("&lt;&lt;&nbsp;Main&nbsp;page&nbsp;&gt;&gt;</a>");
	}
	else
	{
        	document.write("<a class=\"middletextstyle\" href=\"" + home + "index.html\">");
		document.write("&lt;&lt;&nbsp;Strona&nbsp;główna&nbsp;&gt;&gt;</a>");
	}
	document.write("</td></tr>");
	*/
	document.write("<td width=\"100%\" align=\"center\">");
	if (english == 1)
		document.write("<a href=\"javascript:wyjdz()\"><img src=\"" + home + "images/up.gif\" alt=\"Go back\" border=\"0\"></a>");
	else
		document.write("<a href=\"javascript:wyjdz()\"><img src=\"" + home + "images/up.gif\" alt=\"Powrót\" border=\"0\"></a>");
	document.write("</td></tr>");
	document.write("<tr><td width=\"100%\" align=\"center\">");
	if (english == 1)
	{
		document.write("<a href=\"javascript:poprzedni()\"><img src=\"" + home + "images/left.gif\" alt=\"Previous\" border=\"0\"></a>");
		document.write("<a href=\"javascript:nastepny()\"><img src=\"" + home + "images/right.gif\" alt=\"Next\" border=\"0\"></a>");
	}
	else
	{
		document.write("<a href=\"javascript:poprzedni()\"><img src=\"" + home + "images/left.gif\" alt=\"Poprzedni\" border=\"0\"></a>");
		document.write("<a href=\"javascript:nastepny()\"><img src=\"" + home + "images/right.gif\" alt=\"Następny\" border=\"0\"></a>");
	}		
	document.write("</td></tr>");
	document.write("</table>");	
}


function printHead()
{
	document.write("<a class=\"podpis\"><b>Małgorzata Wielek-Mandrela</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menuItem + "</a>");
}

function printTitle()
{
	document.write("<a class=\"podpis\" name=\"podpis\" >&nbsp;</a>&nbsp;&nbsp;");
	document.write("<a class=\"wymiary\" name=\"wymiary\">&nbsp;</a>&nbsp;&nbsp;");
	document.write("<a class=\"data\" name=\"data\">&nbsp;</a>&nbsp;&nbsp;");
	document.write("<a class=\"cena\" name=\"cena\">&nbsp;&nbsp;</a>");
}


