var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10037", "M_C3_B6bel_20_X7_20Einrichtungen", "/moebel-einrichtungen/index.html", 1, "", 1, "");
addItem("10038", "Regale_20_X7_20Aufbewahrung", "/moebel-einrichtungen/regale-aufbewahrung/index.html", 2, "", 1, "");
addItem("10035", "Kleinm_C3_B6bel", "/moebel-einrichtungen/kleinmoebel/index.html", 2, "", 1, "");
addItem("10036", "Sofas_20_X7_20Sessel", "/sofas-sessel/index.html", 1, "", 1, "");
addItem("10020", "Relaxsessel", "/sofas-sessel/fernsehsessel-relaxsessel-ruhesessel/index.html", 2, "", 1, "");
addItem("10039", "Bettsofas", "/sofas-sessel/bettsofas/index.html", 2, "", 1, "");
addItem("10021", "Dekoration", "/dekoration/index.html", 1, "", 1, "");
addItem("10022", "Schalen_20_X7_20Vasen", "/dekoration/schalen-vasen/index.html", 2, "", 1, "");
addItem("10023", "Geflecht_20_X7_20Korb", "/dekoration/geflecht-und-korb/index.html", 2, "", 1, "");
addItem("10024", "Taschen_20_X7_20K_C3_B6rbe", "/dekoration/taschen-koerbe/index.html", 2, "", 1, "");
addItem("10026", "Schachteln_20_X7_20Dosen", "/dekoration/schachteln-dosen/index.html", 2, "", 1, "");
addItem("10025", "Wohnaccessoire", "/dekoration/wohnaccessoire/index.html", 2, "", 1, "");
addItem("10030", "Freizeit_X2_20_X7_20Gartenm_C3_B6bel", "/freizeitmoebel-gartenmoebel/index.html", 1, "", 1, "");
addItem("10040", "Korb_20_X7_20Rattan", "/freizeitmoebel-gartenmoebel/geflechtmoebel/index.html", 2, "", 1, "");
addItem("10031", "ALU_X2Geflechtm_C3_B6bel", "/freizeitmoebel-gartenmoebel/aluminiummoebel-geflechtmoebel/index.html", 2, "", 1, "");
addItem("10032", "Louisiana", "/freizeitmoebel-gartenmoebel/aluminiummoebel-geflechtmoebel/louisiana/index.html", 3, "", 1, "");
addItem("10033", "Comtesse", "/freizeitmoebel-gartenmoebel/aluminiummoebel-geflechtmoebel/comtesse/index.html", 3, "", 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;
		
	};
};