var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10011", "Trikot", "/pi11/index.html", 1, "", 1, "");
addItem("1007", "Kattun_20_X4_20Bunt_20B_20_X4Schwerputz", "/pi7/index.html", 1, "", 1, "");
addItem("10026", "Frottee_20Bunt", "/pi26/index.html", 1, "", 1, "");
addItem("10015", "Poliertextilien", "/pi15/index.html", 1, "", 1, "");
addItem("1008", "Vliest_C3_BCcher", "/pi8/index.html", 1, "", 1, "");
addItem("10010", "Putzwolle", "/pi10/index.html", 1, "", 1, "");
addItem("10022", "Sp_C3_BCl_X2_20und_20Wischt_C3_BCcher", "/pi22/index.html", 1, "", 1, "");
addItem("10023", "Reinigungst_C3_BCcher", "/pi23/index.html", 1, "", 1, "");
addItem("10024", "Zellstofft_C3_BCcher", "/pi24/index.html", 1, "", 1, "");
addItem("10028", "Microfasert_C3_BCcher", "/pi28/index.html", 1, "", 1, "");
addItem("10029", "Fenstert_C3_BCcher_20_X4_20fusselfreie_20T_C3_BCcher", "/pi29/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;
		
	};
};