var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10018", "NINTENDO_20DS_20LITE_20SPIELE_20KONSOLEN", "/nintendo-ds-lite-spiele3/index.html", 1, "", 1, "");
addItem("10020", "LERNSPIELE_20_20SCHULSPIELE_20(5)", "/nintendo-ds-lite-spiele3/lernspiele-schulspiele/index.html", 2, "", 1, "");
addItem("10021", "ACTION_20_20ADVENTURE_20(5)", "/nintendo-ds-lite-spiele3/action-adventure/index.html", 2, "", 1, "");
addItem("10022", "KINDER_20_20FAMILIE_20(6)", "/nintendo-ds-lite-spiele3/kinder-famlilie/index.html", 2, "", 1, "");
addItem("10023", "SPORT_20(1)", "/nintendo-ds-lite-spiele3/sport/index.html", 2, "", 1, "");
addItem("10034", "KONSOLE_20ZUBEH_C3_96R_20(1)", "/nintendo-ds-lite-spiele3/zubehoer/index.html", 2, "", 1, "");
addItem("1002", "PLAYSTATION_202", "/sony-psp/index.html", 1, "", 1, "");
addItem("10039", "KONSOLEN", "/sony-psp/playstation-2-konsole/index.html", 2, "", 1, "");
addItem("10014", "PLAYSTATION_202_20SPIELE_20(10)", "/playstation-3/sony-psp/index.html", 2, "", 1, "");
addItem("10038", "ZUBEH_C3_96R_20(7)", "/sony-psp/zubehoer/index.html", 2, "", 1, "");
addItem("10053", "PLAYSTATION_203", "/playstation-3/index.html", 1, "", 1, "");
addItem("10037", "KONSOLEN", "/playstation-3/playstation-3-konsole/index.html", 2, "", 1, "");
addItem("10015", "PLAYSTATION_203_20SPIELE_20(5)", "/playstation-3/sony-psp/index2.html", 2, "", 1, "");
addItem("10054", "ZUBEH_C3_96R_20(9)", "/playstation-3/zubehoer/index.html", 2, "", 1, "");
addItem("10048", "NINTENDO_20WII", "/nintendo-wii/index.html", 1, "", 1, "");
addItem("10049", "NINTENDO_20WII_20SPIELE_20(1)", "/nintendo-wii/nintendo-wii-spiele/index.html", 2, "", 1, "");
addItem("10050", "NINTENDO_20WII_20ZUBEH_C3_96R_20(2)", "/nintendo-wii/nintendo-wii-zubehoer/index.html", 2, "", 1, "");
addItem("10051", "XBOX360", "/xbox3602/index.html", 1, "", 1, "");
addItem("10052", "ZUBEH_C3_96R_20(2)", "/xbox3602/zubehoer/index.html", 2, "", 1, "");
addItem("10055", "XBOX360_20SPIELE", "/xbox3602/xbox360-spiel/index.html", 2, "", 1, "");
addItem("10028", "BLUETOOTH_20FREISPRECHEINRICHTUNG_20_20SEECODE", "/bluetooth/index.html", 1, "", 1, "");
addItem("10045", "FREISPRECHEINRICHTUNGEN", "/bluetooth/freisprecheinrichtungen/index.html", 2, "", 1, "");
addItem("10046", "ZUBEH_C3_96R_20(1)", "/bluetooth/zubehoer/index.html", 2, "", 1, "");
addItem("10024", "KRUSELL_20HANDYZUBEH_C3_96R", "/krusell/index.html", 1, "", 1, "");
addItem("10025", "KRUSELL_20HANDYTASCHEN", "/krusell/krusell-handytaschen/index.html", 2, "", 1, "");
addItem("10026", "KRUSELL_20HALTERUNGEN_20(6)", "/krusell/krusell-befestigungssysteme/index.html", 2, "", 1, "");
addItem("10027", "KRUSELL_20CAMMERA_20_X4_20CD_20_X2_20TASCHEN", "/krusell/krusell-camera-cd-taschen/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;
		
	};
};