var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10037", "Aktionsmonat_20Juli_20(1)", "/aktionsmonat-mai/index.html", 1, "", 1, "");
addItem("1006", "Bugout_20Gear_20(5)", "/bugout-gear/index.html", 1, "", 1, "");
addItem("10013", "BW_20_X2_20Brotbeutel_20(3)", "/bw-brotbeutel/index.html", 1, "", 1, "");
addItem("10032", "Gro_C3_9Fhandelsmengen_20(4)", "/mehr-als-1/index.html", 1, "", 1, "");
addItem("10031", "Regatta_20(1)", "/regatta/index.html", 1, "", 1, "");
addItem("10015", "SONDERANGEBOTE_20(5)", "/sonderangebote/index.html", 1, "", 1, "");
addItem("10023", "Textil_20Veredelungen_20(8)", "/zur-stickerei/index.html", 1, "", 1, "");
addItem("10030", "Stick_20_X2_20Service", "/zur-stickerei/stick-service/index.html", 2, "", 1, "");
addItem("10027", "TILDA_20(14)", "/tilda/index.html", 1, "", 1, "");
addItem("10035", "Trainingsanz_C3_BCge_20(3)", "/trainingsanzuege/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;
		
	};
};