var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001582", "Cuboro", "/cuboro/index.html", 1, "", 1, "");
addItem("1001597", "Grundpackungen", "/cuboro/grundpackungen/index.html", 2, "", 1, "");
addItem("1001598", "Erweiterungen", "/cuboro/erweiterungen/index.html", 2, "", 1, "");
addItem("1001599", "Zubeh_C3_B6r", "/cuboro/zubehoer/index.html", 2, "", 1, "");
addItem("1001584", "Haba", "/haba/index.html", 1, "", 1, "");
addItem("1001588", "Grundbausets", "/haba/grundbausets/index.html", 2, "", 1, "");
addItem("1001589", "Erweiterungen", "/haba/erweiterungen/index.html", 2, "", 1, "");
addItem("1001585", "Nic", "/nic/index.html", 1, "", 1, "");
addItem("1001591", "Classic_20Bahnen", "/nic/komplettbahnen/index.html", 2, "", 1, "");
addItem("1001593", "Laufteile", "/nic/laufteile/index.html", 2, "", 1, "");
addItem("1001592", "cubio_20System", "/nic/cubio-kugelbahnsystem/index.html", 2, "", 1, "");
addItem("1001586", "Quadrilla", "/quadrilla/index.html", 1, "", 1, "");
addItem("1001594", "Grundsets", "/quadrilla/komplettsets/index.html", 2, "", 1, "");
addItem("1001596", "Erg_C3_A4nzungssets", "/quadrilla/erweiterungssets/index.html", 2, "", 1, "");
addItem("1001595", "Erweiterungsteile", "/quadrilla/erweiterungsteile/index.html", 2, "", 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;
		
	};
};