var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10050", "Digital_X2Pianos", "/digital-pianos/index.html", 1, "", 1, "");
addItem("10027", "Yamaha", "/digital-pianos/yamaha/index.html", 2, "", 1, "");
addItem("1004", "Kawai", "/digital-pianos/kawai/index.html", 2, "", 1, "");
addItem("10019", "Roland", "/digital-pianos/roland/index.html", 2, "", 1, "");
addItem("10072", "Lifestyle_20Pianos", "/digital-pianos/yamaha-lifestyle-pianos/index.html", 2, "", 1, "");
addItem("10073", "Digital_X2Fl_C3_BCgel", "/digital-pianos/digital-fluegel/index.html", 2, "", 1, "");
addItem("10058", "SPAR_X2PAKETE", "/digital-pianos/spar-pakete/index.html", 2, "", 1, "");
addItem("10062", "Yamaha", "/digital-pianos/spar-pakete/yamaha-digital-pianos/index.html", 3, "", 1, "");
addItem("10063", "Kawai", "/digital-pianos/spar-pakete/kawai-digital-pianos/index.html", 3, "", 1, "");
addItem("10064", "Roland", "/digital-pianos/spar-pakete/roland-digital-pianos/index.html", 3, "", 1, "");
addItem("10065", "Vergleichstabelle", "/digital-pianos/vergleichstabelle/index.html", 2, "", 1, "");
addItem("10044", "Portable_X2Pianos", "/stage-pianos/index.html", 1, "", 1, "");
addItem("10030", "Yamaha", "/stage-pianos/yamaha/index.html", 2, "", 1, "");
addItem("1003", "Kawai", "/stage-pianos/kawai/index.html", 2, "", 1, "");
addItem("10020", "Roland", "/stage-pianos/roland/index.html", 2, "", 1, "");
addItem("10049", "Keyboards", "/portable-keyboards/index.html", 1, "", 1, "");
addItem("10028", "Yamaha", "/portable-keyboards/yamaha/index.html", 2, "", 1, "");
addItem("10018", "Roland", "/portable-keyboards/roland/index.html", 2, "", 1, "");
addItem("1006", "Ketron", "/portable-keyboards/ketron/index.html", 2, "", 1, "");
addItem("10038", "Orgeln", "/heimorgeln/index.html", 1, "", 1, "");
addItem("10080", "Orla_20Orgeln", "/heimorgeln/orla-orgeln/index.html", 2, "", 1, "");
addItem("10034", "Roland_20Atelier_20Orgeln", "/heimorgeln/roland-atelier/index.html", 2, "", 1, "");
addItem("10040", "Sakralorgeln", "/heimorgeln/sakralorgel/index.html", 2, "", 1, "");
addItem("10035", "Content_20Orgeln_20und_20Zubeh_C3_B6r", "/heimorgeln/sakralorgel/content/index.html", 3, "", 1, "");
addItem("10039", "Johannus_20Orgeln", "/heimorgeln/sakralorgel/johannus/index.html", 3, "", 1, "");
addItem("10079", "Zubeh_C3_B6r_20und_20Optionen", "/heimorgeln/sakralorgel/johannus/zubehoer-und-optionen/index.html", 4, "", 1, "");
addItem("10041", "Roland_20Classic", "/heimorgeln/sakralorgel/roland/index.html", 3, "", 1, "");
addItem("10043", "Rodgers_20Orgeln", "/heimorgeln/sakralorgel/rodgers/index.html", 3, "", 1, "");
addItem("10047", "Viscount_20Orgeln", "/heimorgeln/sakralorgel/viscount/index.html", 3, "", 1, "");
addItem("10081", "Zubeh_C3_B6r_20und_20Optionen", "/heimorgeln/sakralorgel/viscount/viscount-zubehoer/index.html", 4, "", 1, "");
addItem("10042", "Noten,_20Leuchten,_20Zubeh_C3_B6r", "/zubehoer/index.html", 1, "", 1, "");
addItem("1001", "Abdeckhauben", "/zubehoer/abdeckhauben/index.html", 2, "", 1, "");
addItem("1002", "B_C3_A4nke_20_X2_20St_C3_BChle", "/zubehoer/baenke-stuehle/index.html", 2, "", 1, "");
addItem("10070", "Klavierleuchten", "/zubehoer/klavierleuchten/index.html", 2, "", 1, "");
addItem("1007", "Kopfh_C3_B6rer", "/zubehoer/kopfhoerer/index.html", 2, "", 1, "");
addItem("10015", "Netzteile", "/zubehoer/netzteile/index.html", 2, "", 1, "");
addItem("10016", "Pedale", "/zubehoer/pedale/index.html", 2, "", 1, "");
addItem("10021", "St_C3_A4nder", "/zubehoer/staender/index.html", 2, "", 1, "");
addItem("10022", "Taschen", "/zubehoer/taschen/index.html", 2, "", 1, "");
addItem("10061", "Noten", "/zubehoer/noten/index.html", 2, "", 1, "");
addItem("10052", "Gebraucht", "/2nd-hand/index.html", 1, "", 1, "");
addItem("10032", "Keyboards", "/2nd-hand/keyboards/index.html", 2, "", 1, "");
addItem("10036", "Digital_X2Pianos", "/2nd-hand/digital-pianos/index.html", 2, "", 1, "");
addItem("10056", "Heimorgeln", "/2nd-hand/heimorgeln/index.html", 2, "", 1, "");
};

var m_sSelectedOptionValue = '0';
function printCatnavDropdown(){
	document.write('<select id="catdropdown" style="width:100%"></select>');
	SMShop.base.addMember("CatnavDropdown");
};

function CatnavDropdown_windowOnLoad(args){
	var oItems = g_oPopupMenu.selectItems(0, true);
	var selCatDropDown = $('catdropdown'),oOption = null, sDepth = '';

	if(m_sSelectedOptionValue == '0'){
		oOption = selCatDropDown[selCatDropDown.length] = new Option();
		with(oOption){
			selected='selected';
			text='<Warengruppen>';
			value = '0';
		}
	};

	oItems.each(function(oItem) {
		sDepth = ''; for(var i=1;i<parseInt(oItem.depth);i++) sDepth += '-';
		oOption = selCatDropDown[selCatDropDown.length] = new Option();
		with(oOption){
			if(oItem.id == m_sSelectedOptionValue) selected = 'selected';
			text = sDepth + ' ' + oItem.caption;
			value = oItem.id;
		}}
	);

	selCatDropDown.onchange = function(){
		var oItem = g_oPopupMenu.selectSingleItem(this.value);
		
		location.href = SMOMAbsoluteRootURL + oItem.url;
		
	};
};