
var langDB = new Array("en","de","it","fr","es");

function SubMenuVoice(id, lab)
{
	this.smvID	= id; // file name = SubMenuItem.smId + '_' + smvId 
	this.smvLabel = lab;
}
function SubMenuItem(id, lab, vc)
{
	this.smID = id; // also file name
	this.smLabel = lab;
	this.smVoices = vc;
}
function MenuItem(id, lab, sbi)
{
	this.mId = id; // also folder (file) name
	this.mLabel = lab;
	this.mSubItems = sbi;
}

function langIndex(lng)
{
	for(index = 0; index < langDB.length; index++)
		if(langDB[index] == lng)
			return index;
	if(index >= langDB.length)
		return 0;
}
function getLabel(labarr, lng)
{
	idx = langIndex(lng);
	if(labarr)
		if(labarr[idx] != "")
	 		return labarr[idx];
		else
			return labarr[0];
}
function getDbMenuItemObj(id)
{
	for(i = 0; i < menuCount; i++)
		if(menuBar[i].mId == id)
			return menuBar[i];
	return null;
}
function getDbSubMenuItemObj(mobj,id)
{
	for(i = 0; i < mobj.mSubItems.length; i++)
		if(mobj.mSubItems[i].smID == id)
			return mobj.mSubItems[i];
	return null;
}
function getDbSubMenuVoiceObj(smobj,id)
{
	for(i = 0; i < smobj.smVoices.length; i++)
		if(smobj.smVoices[i].smvID == id)
			return smobj.smVoices[i];
	return null;
}
function hasLabelLang(labarr, lng)
{
	idx = langIndex(lng);
	if(labarr)
		return (labarr[idx] != "");
	return 0;
}
function hasLanguage(path,nam1,nam2,lng)
{
	obj = getDbMenuItemObj(path);
	if(path == nam1)
		return hasLabelLang(obj.mLabel,lng);
	obj = getDbSubMenuItemObj(obj,nam1)
	if(nam2=="")
		return hasLabelLang(obj.smLabel,lng);
	obj = getDbSubMenuVoiceObj(obj,nam2);
	return hasLabelLang(obj.smvLabel,lng);
}

/* menu DB */

var menuBar = new Array();
var menuCount = 0;

menuBar[menuCount++] = 
	new MenuItem("news", 
	new Array("News","News","News","",""),
	null  // SubMenuItem
);

menuBar[menuCount++] = 
	new MenuItem("products", // foldername
	new Array("Arrangers","","","",""), // labels ("en","de","it","fr","es")
  new Array(
		new SubMenuItem("pa2x", // filename
		  new Array("Pa2X","Pa2X","Pa2X","Pa2X","Pa2X"), // labels
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa1xpro_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				new SubMenuVoice("comp",
				new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		),
		new SubMenuItem("pa800", 
			new Array("Pa800","Pa800","Pa800","Pa800","Pa800"),
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa80_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				new SubMenuVoice("comp",
				new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		),
		new SubMenuItem("pa500", 
			new Array("Pa500","Pa500","Pa500","Pa500","Pa500"),
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa1xpro_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demos","Demo","Demo","Démonstrations","Demo")),
				new SubMenuVoice("comp",
				new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		),
		new SubMenuItem("pa500loc", 
			new Array("Pa500 Local","Pa500 Local","Pa500 Local","Pa500 Local","Pa500 Local"),
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa1xpro_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demos","Demo","Demo","Démonstrations","Demo")),
				// new SubMenuVoice("comp",
				// new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		),
		new SubMenuItem("pa50sd", 
			new Array("Pa50SD","Pa50SD","Pa50SD","Pa50SD","Pa50SD"),
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa1xpro_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demos","Demo","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		),
		new SubMenuItem("pa588", 
			new Array("Pa588","Pa588","Pa588","Pa588","Pa588"),
			new Array(
				new SubMenuVoice("info", // appended to filename eg: 'pa1x_info'
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software")),
				new SubMenuVoice("faq",
				new Array("Faq","Faq","Faq","Faq","Faq"))
			)
		)
	)
);

menuBar[menuCount++] = 
	new MenuItem("products1", 
	new Array("Pianos","","","",""),
  new Array(
		new SubMenuItem("sv1", 
			new Array("SV1","SV1","SV1","SV1","SV1"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("opt",
				new Array("Options","Optionen","Opzioni","Les Options","Opciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales")),
				new SubMenuVoice("soft",
				new Array("Software","Software","Software","Software","Software"))
			)
		),
		new SubMenuItem("sp250", 
			new Array("SP-250","SP-250","SP-250","SP-250","SP-250"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"))
			)
		),
		new SubMenuItem("lp350", 
			new Array("LP-350","LP-350","LP-350","LP-350","LP-350"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"))
			)
		),
		new SubMenuItem("c720", 
			new Array("C-720","C-720","C-720","C-720","C-720"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"))
			)
		),
		new SubMenuItem("c540", 
			new Array("C-540","C-540","C-540","C-540","C-540"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"))
			)
		),
		new SubMenuItem("c340", 
			new Array("C-340","C-340","C-340","C-340","C-340"),
			new Array(
				new SubMenuVoice("info",
				new Array("Information","Information","Informazioni","Informations","Información")), // labels
				new SubMenuVoice("spec",
				new Array("Specifications","Technische Daten","Specifiche","Caractéristiques","Especificaciones")),
				new SubMenuVoice("demo",
				new Array("Demo","Demos","Demo","Démonstrations","Demo")),
				//new SubMenuVoice("comp",
				//new Array("Comparison","Vergleichstabelle","Comparazione","Tableau","Comparación")),
				new SubMenuVoice("man",
				new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"))
			)
		)
  )
//	null  // SubMenuItem
);


menuBar[menuCount++] = 
	new MenuItem("support", 
	new Array("Support","Support","Supporto","",""),
  new Array(
		new SubMenuItem("tutorials", 
		new Array("Tutorials","Tutorials","Tutorials","Tutorials","Tutorials"),
			null
		),
		new SubMenuItem("faq", 
		new Array("Faq","Faq","Faq","Faq","Faq"),
			null
		),
		new SubMenuItem("manuals", 
		new Array("Manuals","Bedienungsanl.","Manuali","Les Manuels","Manuales"),
			null
		),
		new SubMenuItem("software", 
		new Array("Software","Software","Software","Software","Software"),
			null
		),
		new SubMenuItem("demo", 
		new Array("Demo","Demo","Demo","Démonstrations","Demo"),
			null
		),
		new SubMenuItem("schematics", 
		new Array("Schematics","Diagramme","Schemi elettrici","Schémas","Diagramas"),
			null
		)
	)
);

menuBar[menuCount++] = 
	new MenuItem("extra", 
	new Array("Extra","Extra","Extra","Extra","Extra"),
  new Array(
		new SubMenuItem("bonusware", 
		new Array("BonusWare","BonusWare","BonusWare","BonusWare","BonusWare"),
		  null // SubMenuVoice
		),
		new SubMenuItem("suggested_songs", 
		new Array("Suggested Songs","Suggested Songs","Suggested Songs","Suggested Songs","Suggested Songs"),
		  null // SubMenuVoice
		),
		new SubMenuItem("korgstory", 
			new Array("Arranger History","Arranger History","Arranger History","Arranger History","Arranger History"),
			new Array(
				new SubMenuVoice("sas20",
				new Array("SAS-20","","","","")),
				new SubMenuVoice("i1",
				new Array("i1","","","","")),
				new SubMenuVoice("i2",
				new Array("i2","","","","")),
				new SubMenuVoice("i3",
				new Array("i3","","","","")),
				new SubMenuVoice("i4S",
				new Array("i4S","","","","")),
				new SubMenuVoice("i5S",
				new Array("i5S","","","","")),
				new SubMenuVoice("i5M",
				new Array("i5M","","","","")),
				new SubMenuVoice("ih",
				new Array("ih","","","","")),
				new SubMenuVoice("iX300",
				new Array("iX300","","","","")),
				new SubMenuVoice("iS40",
				new Array("iS40","","","","")),
				new SubMenuVoice("iS50",
				new Array("iS50","","","","")),
				new SubMenuVoice("i30",
				new Array("i30-i30HD","","","","")),
				new SubMenuVoice("i40M",
				new Array("i40M","","","","")),
				new SubMenuVoice("iS35",
				new Array("iS35","","","","")),
				new SubMenuVoice("iS50B",
				new Array("iS50B","","","","")),
				new SubMenuVoice("Pa50",
				new Array("Pa50","","","","")),
				new SubMenuVoice("Pa60",
				new Array("Pa60","","","","")),
				new SubMenuVoice("Pa80",
				new Array("Pa80","","","","")),
				new SubMenuVoice("Pa1X",
				new Array("Pa1X","","","",""))				
			)
		),
			new SubMenuItem("links", 
			new Array("Links","Links","Links","Links","Links"),
			  null // SubMenuVoice
		)
	)
);

menuBar[menuCount++] = 
	new MenuItem("store", 
	new Array("Store","Shop","Negozio","Magasin","Almacén"),
	null // SubMenuItem
);

menuBar[menuCount++] = 
	new MenuItem("contact", 
	new Array("Contacts","Kontakte","Contatti","Contacts","Contactos"),
	null  // SubMenuItem
);

/* menu DB - end */
