var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1008", "R4_20Karte", "/r4-karte/index.html", 1, "", 1, "");
addItem("1004", "R4i_20Karte_20(Red)", "/r4i-karte/index.html", 1, "", 1, "");
addItem("1005", "R4i_20Karte_20(Gold)", "/r4i-karte-gold/index.html", 1, "", 1, "");
addItem("10027", "TTi_20Karte", "/dstti/index.html", 1, "", 1, "");
addItem("1002", "Speicher", "/speicherkarten/index.html", 1, "", 1, "");
addItem("10010", "DS_20Zubeh_C3_B6r", "/nintendo-ds/index.html", 1, "", 1, "");
addItem("10016", "DS_20Lite", "/nintendo-ds/ds-lite/index.html", 2, "", 1, "");
addItem("10017", "DSi", "/nintendo-ds/dsi/index.html", 2, "", 1, "");
addItem("10018", "DSi_20XL", "/nintendo-ds/dsi-xl/index.html", 2, "", 1, "");
addItem("10042", "DS", "/nintendo-ds/ds/index.html", 2, "", 1, "");
addItem("10041", "3DS", "/nintendo-ds/3ds/index.html", 2, "", 1, "");
addItem("10030", "Wii_20Zubeh_C3_B6r", "/nintendo-wii/index.html", 1, "", 1, "");
addItem("10019", "Modchip", "/nintendo-wii/modchip/index.html", 2, "", 1, "");
addItem("10045", "Controller", "/nintendo-wii/controller/index.html", 2, "", 1, "");
addItem("10046", "Ersatzteile", "/nintendo-wii/ersatzteile/index.html", 2, "", 1, "");
addItem("10043", "_X3_X3_X3mehr_20DSShop", "/dsshop/index.html", 1, "", 1, "");
addItem("10040", "NEUHEITEN", "/dsshop/neues/index.html", 2, "", 1, "");
addItem("10025", "AKTIONSWARE", "/dsshop/aktion/index.html", 2, "", 1, "");
addItem("10044", "Fanshop", "/dsshop/fanshop/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;
		
	};
};