var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "HEIMBS", "/pi2/index.html", 1, "", 1, "");
addItem("1007", "ALLEGRETTO", "/pi7/index.html", 1, "", 1, "");
addItem("1001", "ADDITIVPRODUKTE", "/pi1/index.html", 1, "", 1, "");
addItem("10011", "NO_X330", "/pi11/index.html", 1, "", 1, "");
addItem("10024", "Teabags", "/pi11/pi24/index.html", 2, "", 1, "");
addItem("10013", "Schwarzer_20Tee", "/pi11/pi24/pi13/index.html", 3, "", 1, "");
addItem("10022", "Gr_C3_BCner_X4Wei_C3_9Fer_20Tee", "/pi11/pi24/pi22/index.html", 3, "", 1, "");
addItem("1004", "Kr_C3_A4utertee", "/pi11/pi24/pi4/index.html", 3, "", 1, "");
addItem("10026", "Fr_C3_BCchtetee", "/pi11/pi24/pi26/index.html", 3, "", 1, "");
addItem("10016", "Rooibos_X2Tee", "/pi11/pi24/pi16/index.html", 3, "", 1, "");
addItem("10020", "Wellness_X4Specials", "/pi11/pi24/pi20/index.html", 3, "", 1, "");
addItem("10025", "loser_20Tee", "/pi11/pi25/index.html", 2, "", 1, "");
addItem("10027", "Schwarzer_20Tee", "/pi11/pi25/pi27/index.html", 3, "", 1, "");
addItem("10031", "Gr_C3_BCner_X4Wei_C3_9Fer_20Tee", "/pi11/pi25/pi31/index.html", 3, "", 1, "");
addItem("10032", "Kr_C3_A4utertee", "/pi11/pi25/pi32/index.html", 3, "", 1, "");
addItem("10028", "Fr_C3_BCchtetee", "/pi11/pi25/pi28/index.html", 3, "", 1, "");
addItem("10029", "Rooibos_X2Tee", "/pi11/pi25/pi29/index.html", 3, "", 1, "");
addItem("10030", "Wellness_X4Specials", "/pi11/pi25/pi30/index.html", 3, "", 1, "");
addItem("10015", "CHOXO", "/pi15/index.html", 1, "", 1, "");
addItem("10018", "ACCESSOIRES", "/pi18/index.html", 1, "", 1, "");
addItem("1003", "Heimbs", "/pi18/pi3/index.html", 2, "", 1, "");
addItem("1006", "Allegretto", "/pi18/pi6/index.html", 2, "", 1, "");
addItem("10010", "No_X330", "/pi18/pi10/index.html", 2, "", 1, "");
addItem("10014", "Choxo", "/pi18/pi14/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;
		
	};
};