var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Kunststoffwannen_20Standard_20_X4_20H_C3_B6he_2021_20cm", "/kunststoffwannen-standard/index.html", 1, "", 1, "");
addItem("10012", "UVS_20_X4_20H_C3_B6he:4_X25_20cm", "/universal-uvs-hoehe4-5-cm/universal-uvs.html", 1, "", 1, "");
addItem("10013", "UV_20_X4_20H_C3_B6he:_2021_20cm", "/uv-hoehe-21-cm/universal-uv.html", 1, "", 1, "");
addItem("10014", "UVL_20_X4_20H_C3_B6he:_2040_20cm", "/uvl-hoehe-40-cm/universal-uvl.html", 1, "", 1, "");
addItem("10015", "UVXL_20_X4_20ohne_20Gr_C3_B6ssenlimit", "/uvxl-ohne-groessenlimit/index.html", 1, "", 1, "");
addItem("10011", "Sonderformen", "/sonderform/index.html", 1, "", 1, "");
addItem("1008", "Teichbecken", "/teichbecken/index.html", 1, "", 1, "");
addItem("1003", "Schuhtassen", "/schuhtassen/schuhtasse.html", 1, "", 1, "");
addItem("1007", "Ladeneins_C3_A4tze", "/ladeneinsaetze2/index.html", 1, "", 1, "");
addItem("1005", "Monatsangebot", "/monatsangebot/index.html", 1, "", 1, "");
addItem("10010", "Ideenreichtum", "/ideenreichtum/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;
		
	};
};