var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1007", "Gastronomie_X4Gro_C3_9Fk_C3_BCchen", "/pi7/index.html", 1, "", 1, "");
addItem("1001", "Geschirr_X2_20und_20Besteckreinigung", "/pi7/pi1/index.html", 2, "", 1, "");
addItem("10012", "maschinelle_20Geschirrreinigung", "/pi7/pi1/pi12/index.html", 3, "", 1, "");
addItem("10013", "Klarsp_C3_BCler", "/pi7/pi1/pi13/index.html", 3, "", 1, "");
addItem("10014", "Handgeschirrsp_C3_BClmittel", "/pi7/pi1/pi14/index.html", 3, "", 1, "");
addItem("1003", "Oberfl_C3_A4chenreinigung_X4_X2desinfektion", "/pi7/pi3/index.html", 2, "", 1, "");
addItem("1002", "Spezialprodukte", "/pi7/pi2/index.html", 2, "", 1, "");
addItem("10010", "Handreinigung_X4_X2desinfektion", "/pi7/pi10/index.html", 2, "", 1, "");
addItem("1009", "Universal", "/pi7/pi9/index.html", 2, "", 1, "");
addItem("10015", "Entkalker", "/pi7/pi15/index.html", 2, "", 1, "");
addItem("10016", "Dosierhilfen_X4Zubeh_C3_B6r", "/pi7/pi16/index.html", 2, "", 1, "");
addItem("10021", "Metzgereien_X4Fleischereien", "/pi21/index.html", 1, "", 1, "");
addItem("10023", "Schaumreiniger", "/pi21/pi23/index.html", 2, "", 1, "");
addItem("10024", "Spezialprodukte", "/pi21/pi24/index.html", 2, "", 1, "");
addItem("10025", "Geschirrreinigung", "/pi21/pi25/index.html", 2, "", 1, "");
addItem("10022", "Brennereien", "/pi22/index.html", 1, "", 1, "");
addItem("1008", "KFZ_X4Werkstatt", "/pi8/index.html", 1, "bild-auto-small.png", 1, "");
addItem("10018", "KFZ_X2Pflege", "/pi8/pi18/index.html", 2, "", 1, "");
addItem("10019", "Werkstatt", "/pi8/pi19/index.html", 2, "", 1, "");
addItem("10017", "Dosierhilfen_X4Zubeh_C3_B6r", "/pi8/pi17/index.html", 2, "", 1, "");
addItem("10020", "Dosierhilfen_X4Zubeh_C3_B6r", "/pi20/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;
		
	};
};