var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10029", "Angebote_20(2)", "/sonderangebote/index.html", 1, "", 1, "");
addItem("10027", "Backmischungen_20(1)", "/backmischungen/index.html", 1, "", 1, "");
addItem("10032", "Basen_X2Produkte_20(4)", "/basen-produkte/index.html", 1, "", 1, "");
addItem("1003", "Brotaufstriche_20(2)", "/brotaufstriche/index.html", 1, "", 1, "");
addItem("1001", "B_C3_BCcher_20und_20Rezepthefte_20(6)", "/kochbuecher-rezept-hefte/index.html", 1, "", 1, "");
addItem("1004", "Wakeup_X2Kochbuch_20(1)", "/kochbuecher-rezept-hefte/wakeup-kochbuch/index.html", 2, "", 1, "");
addItem("10011", "Wakeup_X2Rezepthefte_20(5)", "/kochbuecher-rezept-hefte/wakeup-rezepthefte/index.html", 2, "", 1, "");
addItem("10036", "Fruchtkonfekt_20(6)", "/fruchtkugeln/index.html", 1, "", 1, "");
addItem("10014", "Gew_C3_BCrze_20(17)", "/wuerzmittel/index.html", 1, "", 1, "");
addItem("10018", "Gew_C3_BCrz_X2Sparsets_20(2)", "/wuerzmittel/gewuerz-sparsets/index.html", 2, "", 1, "");
addItem("10035", "H_C3_B6rb_C3_BCcher_20(1)", "/hoerbuecher/index.html", 1, "", 1, "");
addItem("10010", "Molke_20(19)", "/molkepulver-suessmolke/index.html", 1, "", 1, "");
addItem("10019", "Molke_X2Probep_C3_A4ckchen_20(9)", "/molkepulver-suessmolke/index2.html", 2, "", 1, "");
addItem("1006", "Nudeln_20(4)", "/nudeln/index.html", 1, "", 1, "");
addItem("10016", "Nussiges_20(3)", "/nussiges-nuesse/index.html", 1, "", 1, "");
addItem("10021", "Shaker_20(1)", "/molke-shaker2/index.html", 1, "", 1, "");
addItem("10015", "So_C3_9Fen_20(2)", "/sossen/index.html", 1, "", 1, "");
addItem("10023", "Stevia_20(1)", "/stevia/index.html", 1, "", 1, "");
addItem("10026", "S_C3_BC_C3_9Fes_20(1)", "/suesses/index.html", 1, "", 1, "");
addItem("10012", "Tee_20(1)", "/teemischung/index.html", 1, "", 1, "");
addItem("10013", "Trockenobst_20(18)", "/trockenobst/index.html", 1, "", 1, "");
addItem("10037", "Trockenobst_X2Probierp_C3_A4ckchen_20(8)", "/trockenobst/trockenobst-probierpaeckchen/index.html", 2, "", 1, "");
addItem("10031", "Wakeup_X2Basenkur_20(2)", "/wakeup-basenprogram/index.html", 1, "", 1, "");
addItem("10034", "Wakeup_X2einfach_20Leben_20(1)", "/wakeup-einfach-leben/index.html", 1, "", 1, "");
addItem("10025", "Wakeup_X2Family_20(2)", "/wakeup-family/index.html", 1, "", 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;
		
	};
};