var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "R_C3_A4ucherkerzen", "/raeucherkerzen/index.html", 1, "", 1, "");
addItem("1003", "R_C3_A4ucherkerzen_X2_C3_96fen", "/raeucherkerzen-oefen/index.html", 1, "", 1, "");
addItem("1004", "Neudorfer_20Weihrichkarzl", "/neudorfer-weihrichkarzl/index.html", 1, "", 1, "");
addItem("10012", "Weihrichkarzlmaa", "/weihrauchkerzenmann/index.html", 1, "", 1, "");
addItem("1005", "R_C3_A4ucherkerzen_20und_20Duftharz_20Pyramiden", "/raeucherkerzen-und-duftharz-pyramiden/index.html", 1, "", 1, "");
addItem("1006", "R_C3_A4uchernde_20K_C3_BCchenutensilien", "/raeuchernde-kuechenutensilien/index.html", 1, "", 1, "");
addItem("1001", "Huss_20No1", "/huss-no1/index.html", 1, "", 1, "");
addItem("10011", "1_20K_20Duft_X2Dampflok", "/1-k-duft-dampflok/index.html", 1, "", 1, "");
addItem("10016", "Tischler_20am_20Leimofen", "/tischler-am-leimofen/index.html", 1, "", 1, "");
addItem("10014", "Lichtlpassendmacher", "/lichtlpassendmacher2/index.html", 1, "", 1, "");
addItem("10015", "Weihrichkarzlpfeif", "/weihrichkarzlpfeif/index.html", 1, "", 1, "");
addItem("1009", "Feines_20aus_20Edelstahl", "/feines-aus-edelstahl/index.html", 1, "", 1, "");
addItem("1007", "R_C3_A4ucherkerzen_20in_20hochwertigen_20Verpackungen", "/hochwertige-verpackungen/index.html", 1, "", 1, "");
addItem("1008", "Duftharze", "/duftharze/index.html", 1, "", 1, "");
addItem("10010", "Zubeh_C3_B6r", "/zubehoer/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;
		
	};
};