var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10016", "Designer_20Sofas", "/pi16/index.html", 1, "", 1, "");
addItem("10019", "Rattan", "/pi19/index.html", 1, "", 1, "");
addItem("10014", "Sideboards_20_X7_20Wohnw_C3_A4nde", "/pi14/index.html", 1, "", 1, "");
addItem("10018", "Clubtische_X4Couchtische", "/pi18/index.html", 1, "", 1, "");
addItem("10021", "Tische", "/pi21/index.html", 1, "", 1, "");
addItem("10022", "St_C3_BChle", "/pi22/index.html", 1, "", 1, "");
addItem("10017", "Betten", "/pi17/index.html", 1, "", 1, "");
addItem("10020", "Matratzen_20_X7_20Lattenroste", "/pi20/index.html", 1, "", 1, "");
addItem("10023", "Kleiderschr_C3_A4nke", "/pi23/index.html", 1, "", 1, "");
addItem("10024", "K_C3_BCchen", "/pi24/index.html", 1, "", 1, "");
addItem("10025", "Leuchten", "/pi25/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;
		
	};
};