/**/

function getName()
{
	//alert(LANG + " " + getLang())
	//if(lang=="EN" || lang=="ENG" || lang=="ENGLISH")
	//if(opener.getLang())
	if(parent.getLang()=="EN" || parent.getLang()=="ENG" || parent.getLang()=="ENGLISH")
		return this.english
	else
		return this.polish;
}

function getTarget()
{
	if(parent.getLang()=="EN" || parent.getLang()=="ENG" || parent.getLang()=="ENGLISH")
		return this.targetEn
	else
		return this.targetPl;

	//return this.target;
}

function goTo()
{
	tt = ""
	if(parent.getLang()=="EN" || parent.getLang()=="ENG" || parent.getLang()=="ENGLISH")
		tt = this.scriptEn;
	else
		tt = this.scriptPl;


	if(tt == "")
		return "";
	else if(tt.charAt(tt.length-1) == '/' )
		return tt;
	else if( tt.lastIndexOf(".htm") >0 || tt.lastIndexOf(".php") >0 )
		return tt;
	else
		return ( tt + "_" + parent.getLangSign() + ".html" );
}

function isUrl(tt)
{
	if(tt == "")
		return false;
	else if( tt.lastIndexOf("http://") >0 || tt.lastIndexOf("ftp://") >0 )
		return true;
	else
		return false;
}

function getMyClass()
{
	//alert(this.cssC);
	return this.cssC;
}

//Class :
function MenuItem(polishL, englishL, toScriptsPl, toTargetPl, toScriptsEn, toTargetEn, classCss)
{
	//Variables, which are initiated during file loading:
	this.polish = "";
	if(polishL!="" && polishL!=undefined) this.polish = polishL;

	this.english = "";
	if(englishL!="" && englishL!=undefined) this.english = englishL;

	this.scriptPl = "";
	if(toScriptsPl!="" && toScriptsPl!=undefined) this.scriptPl = toScriptsPl;

	this.targetPl = "";
	if(toTargetPl!="" && toTargetPl!=undefined) this.targetPl = toTargetPl;

	this.scriptEn = "";
	if(toScriptsEn!="" && toScriptsEn!=undefined) this.scriptEn = toScriptsEn;

	this.targetEn = "";
	if(toTargetEn!="" && toTargetEn!=undefined) this.targetEn = toTargetEn;

	this.cssC = "";
	if(classCss!=undefined && classCss!="") this.cssC = classCss;

	//methods are linking :
	this.getName = getName;
	this.getTarget = getTarget;
	this.goTo = goTo;
	this.getMyClass = getMyClass;

	// matrix must be in format:
	//[x][0] - nazwa pliku
	//[x][1] - opis pliku
	//this.myTable = new Array();
	//if(table != null) this.myTable = table;
}



/**/

var menudata = new Array(
//	new Array(
//		new MenuItem("Akademia Medyczna", "Medical University", "http://www.am.edu.pl/", "_parent", "http://www.am.edu.pl/", "_parent")
//	),
//	new Array(
//		"&nbsp;"
//	),
	new Array(
		new MenuItem("Wydział", "department", "", "", "",""),
		new MenuItem("Warszawski Uniwersytet Medyczny", "Medical University", "http://www.wum.edu.pl/", "_parent", "http://www.am.edu.pl/", "_parent"),
		new MenuItem("Władze", "authority", "authority/authority1", "main", "authority/authority1", "main"),
		new MenuItem("Dziekanat", "administration", "http://www.wum.edu.pl/wydzialy/wf/", "_parent", "",""),
		new MenuItem("Zakłady", "divisions", "authority/divisions", "main", "authority/divisions", "main"),
		new MenuItem("Historia", "history", "authority/history", "main", "", ""),
		new MenuItem("kontakt", "contact", "authority/contact", "main", "authority/contact", "main"),
		new MenuItem("dojazd", "localization", "authority/localization", "main", "","") //gdzie jestesmy
	),
	new Array(
		new MenuItem("Nauka", "science", "","", "",""),
		new MenuItem("badania", "reserch", "", "main", "",""),
		new MenuItem("dydaktyka", "education", "", "main", "",""),
		new MenuItem("zlecenia", "services", "", "main", "","")
	),
	new Array(
		new MenuItem("studia", "studies", "", "", "",""),
		new MenuItem("rekrutacja", "enrollment", "http://www2.wum.edu.pl/rekrutacja/", "_parent", "",""),
		new MenuItem("programy", "programmes", "studies/programmes", "main", "",""),
		new MenuItem("materiały", "pamphlets", "studies/pamphlets", "main", "",""),
		new MenuItem("podyplomowe", "A Ph.D. studies", "http://www.am.edu.pl/struktura/ckp/index.html", "_parent", "",""),
		//new MenuItem("samorzad", "student Union", "http://www.medyk.waw.pl/", "_parent", "",""),
		new MenuItem("samorząd", "student Union", "studies/studentUnion", "main", "",""),
		new MenuItem("biblioteka", "library", "studies/library", "main", "",""),
		new MenuItem("lab. komp.", "comp. lab", "studies/lab_comp", "main", "",""),
		new MenuItem("aspekty prawne", "legal aspects", "", "main", "","")
	),
	new Array(
		new MenuItem("rekrutacja", "enrollment", "", "", "",""),
		//new MenuItem("na rok 2009", "for 2009 year", "enrollment/year2009", "main", "",""),
		new MenuItem("na rok 2009", "for 2009 year", "http://www2.wum.edu.pl/rekrutacja/", "_parent", "",""),
		new MenuItem("licencjat", "bachelor studies", "", "main", "",""),
		new MenuItem("magisterium", "M.Sc. studies", "", "main", "",""), //master of science
		new MenuItem("magisterium (po angielsku)", "M.Sc. studies in English", "", "main", "studies/MScstudiesEnglish","main"),
		new MenuItem("doktoranckie", "Ph.D. studies", "studies/PhDstudies", "main", "",""),
		new MenuItem("podyplomowe", "A Ph.D. studies", "studies/APhDstudies", "main", "","")
	),
	new Array(
		new MenuItem("wydarzenia", "events", "", "", "",""),
		new MenuItem("wiadomości", "news", "aktualnosci", "main", "",""),
		new MenuItem("prasa", "press", "", "main", "",""),
		new MenuItem("konferencje", "conferences", "events/conferences", "main", "",""),
		new MenuItem("festiwal nauki", "science party", "http://www.farm.amwaw.edu.pl/~axzimni/festiwal/face.html", "_parent", "http://www.farm.amwaw.edu.pl/~axzimni/festiwal/face.html", "_parent"),
		new MenuItem("imprezy", "party", "", "main", "","")
	),
	new Array(
		//new MenuItem("Biuletyn", "<img src=\"images/foreign/00Biuletyn_index_scal.gif\" border=\"0\"><br>biulletyn", "http://www.farm.amwaw.edu.pl/~axzimni/biuletyn/", "_parent", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent")
		new MenuItem("Biuletyn", "biulletyn", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent")
		//new MenuItem("B<font size=+1>i</font><font size=+2>u</font><font size=+3>l</font><font size=+3>e</font><font size=+2>t</font><font size=+1>y</font>n", "biulletyn", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent")
	),

//	new Array(
//		new MenuItem("test", "test", "", "", "","", "")
//	),

	new Array(
		new MenuItem("Unia Europejska", "European Union", "", "", "","", ""),
		//new MenuItem("współpraca", "cooperation", "EU/EuropeanUnion", "main", "","", "eu-small")
		new MenuItem("<img src=\"images\/eu_flag_s.gif\"> współpraca", "<img src=\"images\/eu_flag_s.gif\"> cooperation", "EU/EuropeanUnion", "main", "","", "eu-small")
	),

	new Array(
		"&nbsp;"
	),
	new Array(
		new MenuItem("galerie", "gallery", "", "main", "",""),
		new MenuItem("wszystkie", "all", "gallery/html/index.htm", "main", "","")
	),
	new Array(
		new MenuItem("Porady", "tips", "", "", "",""),
		new MenuItem("techniczne", "technical", "tips/tips", "main", "",""),
		new MenuItem("prawne", "law", "tips/law", "main", "","")
		//new MenuItem("poczta", "e-mail", "", "main", "",""),
		//new MenuItem("spamy", "spams", "tips/spam", "main", "",""),
		//new MenuItem("konta uż.", "users space", "tips/localSpace", "main", "",""),
		//new MenuItem("strony WWW", "WWW pages", "tips/localWWW", "main", "",""),
		//new MenuItem("aktualizacje", "updates", "", "main", "",""),
		//new MenuItem("wirusy", "viruses", "", "main", "","")
		//new MenuItem("kluster", "cluster", "", "main", "","")
	),
	new Array(
		new MenuItem("strony www", "www pages", "", "", "",""),
		//new MenuItem("pracownicy", "staff", "www/localLinks.php?lang=PL", "main", "www/localLinks.php?lang=EN","main"),
		new MenuItem("pracownicy", "staff", "www/localLinks_atrapa_pl.htm", "main", "","main"),
		new MenuItem("studenci", "students", "", "", "",""),
		new MenuItem("tematyczne", "subject", "www/links", "main", "",""), //farmaceutyczne
		new MenuItem("wiedza", "know", "www/linksKnow", "main", "",""),
		new MenuItem("mapa", "map", "", "main", "","")
	),
	new Array(
		"&nbsp;"
	),
	new Array(
		//new MenuItem("Biuletyn", "<img src=\"images/foreign/00Biuletyn_index_scal.gif\" border=\"0\"><br>biulletyn", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent")
		new MenuItem("podyplomowe", "A Ph.D. studies", "", "", "",""),
		new MenuItem("dla Farmaceutów", "technical", "studies/APhDstudies", "main", "",""),
		new MenuItem("dla Diagnostów", "law", "studies/Diagstudies", "main", "","")
		//new MenuItem("B<font size=+1>i</font><font size=+2>u</font><font size=+3>l</font><font size=+3>e</font><font size=+2>t</font><font size=+1>y</font>n", "biulletyn", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent", "http://www.biuletynfarmacji.wum.edu.pl/", "_parent")
	),
new Array(
		"&nbsp;"
	),
	new Array(
		new MenuItem("spotkanie farmaceutek", "European Union","3_spotkanie_berlin.htm", "_parent", "","")
	),	
new Array(
		"&nbsp;"
	),	

	new Array(
		new MenuItem("Spotkanie Młodej Farmacji", "","1_spotkanie.htm", "_parent", "","")
	),	
new Array(
		"&nbsp;"
	),	
	new Array(
//		new MenuItem("Oferty Pracy", "vacancies", "","", "",""),
//		new MenuItem("Zakład Chemii Fizycznej", "Chemical Physics", "authority/oferta_pl.html", "_parent", //"",""),
//	new MenuItem("Katedra i Zakład Chemii Nieorgranicznej i Analitycznej", "Inorganic Chemistry", //"authority/oferta1_pl.html", "_parent", "","")

	)
	
);

//var menudataShow = new Array();

var menu_item_show_name = "";
var menu_item_show_x = 6;
var menu_item_show_y = 2;
var menu_item_onlyOne = true;
var menu_item_Slower = 1000;

var menu_def_target = "main"


var imgMenuDir_dis = "images/menu_dir_disable.gif";
var imgMenuDir_off = "images/menu_dir_off.gif";
//var imgMenuDir_off = "images/menu_dir_off2.gif";
var imgMenuDir_on = "images/menu_dir_on.gif";
//var imgMenuDir_on = "images/menu_dir_on2.gif";
//var imgMenuDir_on = "images/menu_dir_on3.gif";
var imgMenuDoc_dis = "images/menu_doc_disable.gif";
var imgMenuDoc_off = "images/menu_doc_off.gif";
//var imgMenuDoc_on = "images/menu_doc_on.gif";
var imgMenuDoc_on = "images/menu_doc_on2.gif";
var imgMenuEmpty = "images/menu_empty.gif";
//var imgMenuDir_url = "images/menu_dir_url.gif";
var imgMenuDir_url = "images/menu_dir_url2.gif";
//var imgMenuDoc_url = "images/menu_doc_url.gif";
var imgMenuDoc_url = "images/menu_doc_url2.gif";


function change_img( img )
{
	//var sn = "";
	//s = "";
	for (var i=0; i<document.images.length; i++){
		//sn = document.images[i].src; 
		if( document.images[ i ].src.lastIndexOf(imgMenuDoc_on) >0 )
			document.images[ i ].src = imgMenuDoc_off;
		
		//s = s + sn + "\n";
	}
	
	//alert(s);
	
	//if( document.images[img].src.lastIndexOf(imgMenuDoc_on) >0 )
	//	document.images[img].src = imgMenuDoc_off;
	//else
	if( document.images[img].src.lastIndexOf(imgMenuDoc_off) >0 )
		document.images[img].src = imgMenuDoc_on;
	
	//document.images[Img].src="graph/"+a;
	//else if( tt.lastIndexOf(".htm") >0 || tt.lastIndexOf(".php") >0 )
}

function getItemClass( x, y )
{
	if( typeof(menudata[x][y]) == "object" )
	{
		//alert(menudata[x][y].getClass());
		return "class=\"" + menudata[x][y].getMyClass() + "\"";
	}

	return "";
};

function getItemLinkNode( x, y )
{
	txt ="", txt2 ="", hf="", tg="";
	if( typeof(menudata[x][y]) == "string" )
		txt = menudata[x][y];
	else if( typeof(menudata[x][y]) == "object" )
	{
		txt = menudata[x][y].getName();
		hf = menudata[x][y].goTo();
		tg = menudata[x][y].getTarget();
		if(tg=="") tg = menu_def_target;
	}

	cl = "", oc = "";

//	if(hf=="" && y>0) cl ="class=\"disable\""; else cl = "class=\"pasive\"";
//	if(hf!="" || y==0) oc ="onclick=\"menu_item_click(this);\""; else oc = "";
//	if(hf!="") hf = "href=\"" + hf + "\"";
//	if(tg!="") tg = "target=\"" + tg + "\"";


	if( (hf=="" && y>0) || txt=="&nbsp;") cl ="class=\"disable\""; else cl = "class=\"pasive\"";
	if( (hf!="" || y==0) && txt!="&nbsp;" ) oc ="onclick=\"menu_item_click(this);\""; else oc = "";
	if(hf!="") hf = "href=\"" + hf + "\"";
	if(tg!="") tg = "target=\"" + tg + "\"";

	txt2 = txt;
	
	if(y==0) txt = ""; //"<img src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(y==0 && menudata[i].length>1) txt = "<img src=\"" + imgMenuDir_off + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;" && hf!="") txt = "<img src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = "<img src=\"" + imgMenuDir_dis + "\" border=\"0\">";
	//else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = ""; //<img src=\"images/menu_disable.gif\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && hf!="") txt = "<img src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(hf=="" && txt!="&nbsp;" && txt!="") txt = "<img src=\"" + imgMenuDoc_dis + "\" border=\"0\">";
	else if(hf=="") txt = "<img src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(txt!="&nbsp;" && isUrl(hf)==true ) txt = "<img src=\"" + imgMenuDoc_url + "\" border=\"0\">";
	else if(txt!="&nbsp;" ) txt = "<img src=\"" + imgMenuDoc_off + "\" border=\"0\">";

//	oc="";
	return "<a " + hf + " id=\"goto-" + x + "-" + y + "\" " + " name=\"goto-" + x + "-" + y + "\" " + oc + " " + cl + " " + tg + ">" + txt + txt2 +"<\/a>";

}

function getItemLink( x, y )
{
	id ="", na="", na2="";
	txt ="", txt2 ="", hf="", tg="";
	if( typeof(menudata[x][y]) == "string" )
		txt = menudata[x][y];
	else if( typeof(menudata[x][y]) == "object" )
	{
		txt = menudata[x][y].getName();
		hf = menudata[x][y].goTo();
		tg = menudata[x][y].getTarget();
		if(tg=="") tg = menu_def_target;
	}

	cl = "", oc = "", oc2="";

//	if(hf=="" && y>0) cl ="class=\"disable\""; else cl = "class=\"pasive\"";
//	if(hf!="" || y==0) oc ="onclick=\"menu_item_click(this);\""; else oc = "";
//	if(hf!="") hf = "href=\"" + hf + "\"";
//	if(tg!="") tg = "target=\"" + tg + "\"";


	id = "id=\"goto-" + x + "-" + y + "\"";
	na = "name=\"goto-" + x + "-" + y + "\"";
	na2 = "name=\"imggoto-" + x + "-" + y + "\"";
	if(y>0) oc2 = "change_img('imggoto-" + x + "-" + y + "')";

	if( (hf=="" && y>0) || txt=="&nbsp;") cl ="class=\"disable\""; else cl = "class=\"pasive\"";
	if( (hf!="" || y==0) && txt!="&nbsp;" ) oc ="onclick=\"menu_item_click(this); " + oc2 + "\""; else oc = "";
	if(hf!="") hf = "href=\"" + hf + "\"";
	if(tg!="") tg = "target=\"" + tg + "\"";
	//if(y==0 && menudata[i].length>1) txt = "+";
	//else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = "#";
	//else if(txt!="&nbsp;") txt = "-";

	txt2 = txt;
	
	
	if(y==0) txt = ""; //"<img src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(y==0 && menudata[i].length>1) txt = "<img " + na2 + " src=\"" + imgMenuDir_off + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;" && hf!="") txt = "<img " + na2 + " src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = "<img " + na2 + " src=\"" + imgMenuDir_dis + "\" border=\"0\">";
	//else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = ""; //<img src=\"images/menu_disable.gif\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && hf!="") txt = "<img " + na2 + " src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(hf=="" && txt!="&nbsp;" && txt!="") txt = "<img " + na2 + " src=\"" + imgMenuDoc_dis + "\" border=\"0\">";
	else if(hf=="") txt = "<img " + na2 + " src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(txt!="&nbsp;" && isUrl(hf)==true ) txt = "<img " + na2 + " src=\"" + imgMenuDoc_url + "\" border=\"0\">";
	else if(txt!="&nbsp;" ) txt = "<img " + na2 + " src=\"" + imgMenuDoc_off + "\" border=\"0\">";

//	oc="";
	return "<a " + hf + " " + id + " " + na + " " + oc + " " + cl + " " + tg + ">" + txt + txt2 +"<\/a>";

}
function getItemNode( x, y )
{
	txt ="", hf="", tg="";
	if( typeof(menudata[x][y]) == "string" )
		txt = menudata[x][y];
	else if( typeof(menudata[x][y]) == "object" )
	{
		txt = menudata[x][y].getName();
		hf = menudata[x][y].goTo();
		tg = menudata[x][y].getTarget();
		if(tg=="") tg = menu_def_target;
	}

	cl = "", oc = "";

	if( (hf=="" && y>0) || txt=="&nbsp;") cl ="class=\"disable\""; else cl = "class=\"pasive\"";
	if( (hf!="" || y==0) && txt!="&nbsp;" ) oc ="onclick=\"menu_item_click(this);\""; else oc = "";
	if(hf!="") hf = "href=\"" + hf + "\"";
	if(tg!="") tg = "target=\"" + tg + "\"";
	//if(y==0 && menudata[i].length>1) txt = "+";
	//else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = ""; //"#"
	//else if(txt!="&nbsp;") txt = "-";
	if(y>0) txt = "<img src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(y==0 && menudata[i].length>1) txt = "<img src=\"" + imgMenuDir_off + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;" && hf!="") txt = "<img src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = "<img src=\"" + imgMenuDir_dis + "\" border=\"0\">";
	//else if(y==0 && menudata[i].length<=1 && txt!="&nbsp;") txt = ""; //<img src=\"images/menu_disable.gif\" border=\"0\">";
	else if(y==0 && menudata[i].length<=1 && hf!="") txt = "<img src=\"" + imgMenuDir_url + "\" border=\"0\">";
	else if(hf=="" && txt!="&nbsp;" && txt!="") txt = "<img src=\"" + imgMenuDoc_dis + "\" border=\"0\">";
	else if(hf=="") txt = "<img src=\"" + imgMenuEmpty + "\" border=\"0\">";
	else if(txt!="&nbsp;" && isUrl(hf)==true ) txt = "<img src=\"" + imgMenuDoc_url + "\" border=\"0\">";
	else if(txt!="&nbsp;" ) txt = "<img src=\"" + imgMenuDoc_off + "\" border=\"0\">";


//	oc = "";
	return "<a " + hf + " id=\"goto-" + x + "-" + y + "\" " + " name=\"goto-" + x + "-" + y + "\" " + oc + " " + cl + " " + tg + ">" + txt +"<\/a>";

	/*
	if( y == 0 )
		if(menudata[i].length>1)
			return "<a name=\"goto-" + x + "-" + y + "\" onclick=\"menu_item_click(this);\">" + "+" +"<\/a>";
		else
			return "<a name=\"goto-" + x + "-" + y + "\" onclick=\"menu_item_click(this);\">" + "" +"<\/a>";
		//return "<a name=\"" + x + "-" + y + "\" onclick=\"menu_item_click(this);\">" + "<img src=\"\">" +"<\/a>";
	else
		if(hf=="")
			return "<a name=\"goto-" + x + "-" + y + "\">" + "-" +"<\/a>";
			//return "<a name=\"goto-" + x + "-" + y + "\" onclick=\"menu_item_click(this);\" target=\"" + tg + "\">" + "-" +"<\/a>";
		else
			return "<a href=\"" + hf + "\" name=\"goto-" + x + "-" + y + "\" onclick=\"menu_item_click(this);\" target=\"" + tg + "\">" + "-" +"<\/a>";

		//return "<a href=\"\" name=\"" + x + "-" + y + "\" onclick=\"menu_item_click(this);\">" + "<img src=\"\">" +"<\/a>";
	*/
}

//var nMenuTable=0;
//var theMenuTable = null, theMenuTableBody = null
var theMenuTableTitle = new Array(), theMenuTableBodyTitle = new Array();
var theMenuTable = new Array(), theMenuTableBody = new Array();
function initMenuTable(x)
{
	//x = parseInt(x);

	if( theMenuTableBody[x] != null )
		return;

	stp = "0menuTable-"+x
	theMenuTableTitle[x] = (likeBrowser('IE')) ? document.all[stp] : document.getElementById(stp);
	theMenuTableBodyTitle[x] = theMenuTableTitle[x].tBodies[0];
	
		
	st = "menuTable-"+x
	//theMenuTable[x] = (document.all) ? document.all.st : document.getElementById(st);
	//theMenuTable[x] = (document.all) ? document.all[st] : document.getElementById(st);
	theMenuTable[x] = (likeBrowser('IE')) ? document.all[st] : document.getElementById(st);
	theMenuTableBody[x] = theMenuTable[x].tBodies[0];

	//myTT = (likeBrowser('IE')) ? document.all[st] : document.getElementById(st);
	//myBB = myTT.tBodies[0];
	//alert(x + " " + myBB + " " + myBB.rows.length);

	//alert(browser + " - " + likeBrowser('IE') + " - " );

};

//function printMenu()
//{
//	for(i=0; i<menudata.length; i++)
//	{

		//oc ="onclick=\"menu_item_click(this);\""
		//document.write( "<span onmouseover=\"openSubmenu(" + i + ");\" onmouseout=\"closeSubmenu(" + i + ");\">" );
//		document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"" + 0 + "\" id=\"menuTable-" + i + "\">" );

//		for(j=0; j<menudata[i].length; j++)
//		{
//			if( i != menu_item_show_x && j != 0 )
//				continue;

//			if(j==0) //background=\"images/eu_flag_s.gif\"
//				document.write( "<tr><td colspan=\"2\">" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
//			else
//				document.write( "<tr><td>&nbsp;</td><td>" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
//		}

//		document.write( "</table>\n" );
		//document.write( "</span>" );

//		initMenuTable(i);
//	}

//};


function SwitchMenu(obj){
	if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		
		var curr_disp = el.style.display;
		
		//alert (ar.length );
		for (var i=0; i<ar.length; i++){
			
			//if (ar[i].className=="submenu")
			//	ar[i].style.display = "none";
			ar[i].style.display = "none";
		}
		
		//if(el.style.display != "block"){
		//	el.style.display = "block";
		//}else{
		//	el.style.display = "none";
		//}
		
		if(curr_disp != "block"){
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function printMenu()
{
	document.write( "<div id=\"masterdiv\">" );
	
	for(i=0; i<menudata.length; i++)
	{

		//oc ="onclick=\"menu_item_click(this);\""
		//document.write( "<span onmouseover=\"openSubmenu(" + i + ");\" onmouseout=\"closeSubmenu(" + i + ");\">" );
		

		
		
		if( menudata[i].length > 0 )
		{
			document.write( "<div onclick=\"SwitchMenu('menuTableSpan-" + i + "')\">" );
			
			document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"" + 0 + "\" id=\"0menuTable-" + i + "\">" );
			j = 0;
			//document.write( "" + getItemNode( i, j ) + " " + getItemLink( i, j ) + "<br>" );
			document.write( "<tr><td colspan=\"2\">" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
			document.write( "</table>\n" );
				
			document.write( "</div>" );
		}
		
		document.write( "<span id=\"menuTableSpan-" + i + "\" style=\"display: none;\">" );

		document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"" + 0 + "\" id=\"menuTable-" + i + "\">" );
		
		for(j=0; j<menudata[i].length; j++)
		{
//			if( i != menu_item_show_x && j != 0 )
//				continue;

			if(j==0) //background=\"images/eu_flag_s.gif\"
				; //document.write( "<tr><td colspan=\"2\">" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
			else
				//document.write( "&nbsp;&nbsp;" + getItemLinkNode( i, j ) + "<br>" );
				//document.write( "&nbsp;&nbsp;" + getItemNode( i, j ) + "" + getItemLink( i, j ) + "" );
				document.write( "<tr><td>&nbsp;</td><td>" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
				//document.write( "<tr><td>&nbsp;</td><td>" + getItemNode( i, j ) + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
		}

		document.write( "</table>\n" );
		document.write( "</span>" );

		initMenuTable(i);
	}
	
	document.write( "</span>" );
};


function reprintMenu()
{
	//theMenuTableBody[x]

	var newCell, newRow

	//for(i=0; i<menudata.length; i++)
	for(i=0; i<theMenuTableBodyTitle.length; i++)
	{
		ix = 1
		j=0
		theMenuTableBodyTitle[i].rows[j].cells[ix].innerHTML = "<td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td>"
	}

	for(i=0; i<theMenuTableBody.length; i++)
	{
		if(typeof(theMenuTableBody[i]) == "object")
		for( j=0 ; j<theMenuTableBody[i].rows.length ; j++ )
		{
			//if (j < 1)
			//	continue;
			//var ss = "goto-" + i + "-" + j + "";
			//alert ( document.anchors[ss].name );
			//ix = 1
			//if(j>0)
				ix =2

			//alert(theMenuTableBody[i].rows[0].cells.length);
			//theMenuTableBody[i].rows[0].cells[ix].innerHTML = "<td>" + getItemLink( i, j ) + "</td>"
			theMenuTableBody[i].rows[j].cells[ix].innerHTML = "<td " + getItemClass( i, j+1 ) + ">" + getItemLink( i, j+1 ) + "</td>"
			//alert(theMenuTableBody[i].rows[j].cell[1].value);

			//if(j>0)
				theMenuTableBody[i].rows[j].cells[ix-1].innerHTML = "<td>" + getItemNode( i, j+1 ) + "</td>"
				//document.write( "<tr><td colspan=\"2\">" +  + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
		}
	}

};

//function reprintMenu()
//{
	//theMenuTableBody[x]

//	var newCell, newRow

	//for(i=0; i<menudata.length; i++)
//	for(i=0; i<theMenuTableBody.length; i++)
//	{
//		for( j=0 ; j<theMenuTableBody[i].rows.length ; j++ )
//		{
			//var ss = "goto-" + i + "-" + j + "";
			//alert ( document.anchors[ss].name );
//			ix = 1
//			if(j>0) ix =2

			//alert(theMenuTableBody[i].rows[0].cells.length);
			//theMenuTableBody[i].rows[0].cells[ix].innerHTML = "<td>" + getItemLink( i, j ) + "</td>"
//			theMenuTableBody[i].rows[j].cells[ix].innerHTML = "<td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td>"
			//alert(theMenuTableBody[i].rows[j].cell[1].value);

//			if(j>0)
//				theMenuTableBody[i].rows[j].cells[ix-1].innerHTML = "<td>" + getItemNode( i, j ) + "</td>"
				//document.write( "<tr><td colspan=\"2\">" +  + "</td><td " + getItemClass( i, j ) + ">" + getItemLink( i, j ) + "</td></tr>" );
//		}
//	}

//};
function menu_item_click( me )
{
	//alert( me.name + " - " );
	
	if( me.name )
	{
		//alert (me.name);
		
		
		if( menu_item_show_name )
		{
			var el = document.getElementById(menu_item_show_name);
			el.src=""
			//alert (el.name + " " + me.name);
		}	
		menu_item_show_name = me.name;
		
		//alert (el.name);
		
	}

}

function old_menu_item_click( me )
{
	//alert("sss");
	//alert( me.name );

	//alert (parent.getLang() + " " + getLang());
	reprintMenu();

	if( me.name )
	{
		idxF=me.name.indexOf("-");

		idx=me.name.indexOf("-", idxF+1);

		x = parseInt(me.name.substr( idxF+1, idx ));
		y = parseInt(me.name.substr(idx+1));

		//alert( me.name + "\n" + x + " " +y);

		if(y>0)
		{
			//......
			//alert("cos robie")
			return;
		}
		else if(isOpenSubmenu(x))
		{
			//alert("juz otwarty -> zamykam")
			closeSubmenu(x);
		}
		else
		{
			if(menu_item_onlyOne)
				closeSubmenu(menu_item_show_x);

			//alert("zamkniety -> otwieram")
			openSubmenu(x);
		}

		menu_item_show_x = x;
		menu_item_show_y = y;

		//a= me.name.substr( 0, idx );
		//b= me.name.substr( idx+1 );
		//alert ("no " + idx + " " + a + " i "  + b + "\nno " + idx + " " + parseInt(a) + " i "  +parseInt(b));
	}
	//alert( menu_item_show_x + " " + menu_item_show_y );

	//openSubmenu( menu_item_show_x );
	//insertItem( menu_item_show_x, menu_item_show_y );


//	a = document.body.clientWidth;
//	b = document.body.clientHeight;

//	na = a - document.getElementById("menu").width-50
//	document.getElementById("main").width = na;

	//document.mysize.ilea.value=a;
	//document.mysize.ileb.value=b;
	//document.mysize.ilei.value = na;

	//document.mysize.ilei.value= (a - document.getElementById("menu").width);
	//document.getElementById("main").width = a - document.getElementById("menu").width;

	//document.getElementById("glu").height=document.body.offsetHeight-document.getElementById("glu").offsetTop-26;

	//HEIGHT
	//window.main.width = a - 130;
	//if (a<300) {alert('Za chwilę wszystko będzie nieczytelne')}
}

function slower()
{
	; //window.setTimeout(";", menu_item_Slower);
}

function isOpenSubmenu(x)
{
	if( theMenuTableBody[x].rows.length == menudata[x].length )
		return true;
	else
		return false;
}

function closeSubmenu(x)
{

	var newCell, newRow

	for( j=theMenuTableBody[x].rows.length-1 ; j > 0 ; j-- )
	{
		//alert (j);
		theMenuTableBody[x].deleteRow(j);
		slower();
	}

}

function openSubmenu(x)
{
	//alert ( x + " - " + menudata[x].length +  " - " + theMenuTableBody[x].rows.length )
	//alert ( menudata[x].join("-") );

	var newCell, newRow

	for( j=theMenuTableBody[x].rows.length ; j<menudata[x].length ; j++ )
	{

		//if(getItemClass( x, j )!="")
		//	alert(getItemClass( x, j ));

		slower();

		newRow = theMenuTableBody[x].insertRow(j)

		newCell = newRow.insertCell(0)
		newCell.innerHTML = "<td>" + "&nbsp;" + "</td>"
		//newCell.style.backgroundColor = "salmon"

		newCell = newRow.insertCell(1)
		newCell.innerHTML = "<td>" + getItemNode( x, j ) + "</td>"
		//newCell.style.backgroundColor = "salmon"

		newCell = newRow.insertCell(2)
		newCell.innerHTML = "<td " + getItemClass( x, j ) + ">" + getItemLink( x, j ) + "</td>"
		//newCell.style.backgroundColor = "salmon"
	}

};
