var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10029", "Sonderposten_20(5)", "/sonderposten/sonderposten.html", 1, "", 1, "");
addItem("1001", "DVI_20_X4_20HDMI_20(5)", "/dvi-hdmi/dvi-hdmi.html", 1, "", 1, "");
addItem("10036", "Festnetz_20Zubeh_C3_B6r_20(28)", "/festnetztelefone/festnetztelefone.html", 1, "", 1, "");
addItem("10037", "Siemens_20(28)", "/festnetztelefone/siemens/index.html", 2, "", 1, "");
addItem("10043", "Akkufachdeckel_20(8)", "/festnetztelefone/siemens/akkufachdeckel/index.html", 3, "", 1, "");
addItem("10044", "G_C3_BCrtelclip_20(10)", "/festnetztelefone/siemens/guertelclip/index.html", 3, "", 1, "");
addItem("10045", "Ladeschale_20(10)", "/festnetztelefone/siemens/ladeschale/index.html", 3, "", 1, "");
addItem("10026", "Handy_20Zubeh_C3_B6r_20(34)", "/handy-zubehoer/handy-zubehoer.html", 1, "", 1, "");
addItem("10027", "Datenkabel_20(2)", "/handy-zubehoer/datenkabel/datenkabel.html", 2, "", 1, "");
addItem("10030", "Taschen_20(9)", "/handy-zubehoer/akkus/ledertaschen.html", 2, "", 1, "");
addItem("10054", "Jim_20Thomson_20(4)", "/handy-zubehoer/akkus/jim-thomson/index.html", 3, "", 1, "");
addItem("10055", "golla_20(5)", "/handy-zubehoer/akkus/golla/index.html", 3, "", 1, "");
addItem("10031", "Akkus_20(20)", "/handy-zubehoer/akkus2/akkus.html", 2, "", 1, "");
addItem("10032", "Motorola_20(5)", "/handy-zubehoer/akkus2/motorola/motorola.html", 3, "", 1, "");
addItem("10034", "SonyEricsson_20(5)", "/handy-zubehoer/akkus2/sonyericsson2/sonyericsson.html", 3, "", 1, "");
addItem("10035", "Nokia_20(10)", "/handy-zubehoer/akkus2/nokia/nokia.html", 3, "", 1, "");
addItem("10059", "Ladeger_C3_A4te_20(3)", "/handy-zubehoer/ladegeraete/index.html", 2, "", 1, "");
addItem("10060", "SonyEricsson_20(3)", "/handy-zubehoer/ladegeraete/sonyericsson/index.html", 3, "", 1, "");
addItem("10021", "Handy_20Ersatzteile_20(106)", "/handy-ersatzteile/handy-ersatzteile2.html", 1, "", 1, "");
addItem("10064", "LG_20(11)", "/handy-ersatzteile/lg/index.html", 2, "", 1, "");
addItem("10023", "Motorola_20(2)", "/handy-ersatzteile/motorola/ersatzteile-motorola.html", 2, "", 1, "");
addItem("10024", "Nokia_20(16)", "/handy-ersatzteile/nokia/ersatzteile-nokia.html", 2, "", 1, "");
addItem("10061", "Samsung_20(19)", "/handy-ersatzteile/samsung/index.html", 2, "", 1, "");
addItem("10022", "Siemens_20(11)", "/handy-ersatzteile/siemens/ersatzteile-siemens.html", 2, "", 1, "");
addItem("10025", "SonyEricsson_20(47)", "/handy-ersatzteile/sonyericsson/sonyericsson2.html", 2, "", 1, "");
addItem("10053", "Navi_20Zubeh_C3_B6r_20(2)", "/navi-zubehoer/index.html", 1, "", 1, "");
addItem("10056", "MP3_20Zubeh_C3_B6r_20(2)", "/mp3-zubehoer/index.html", 1, "", 1, "");
addItem("10057", "Taschen_20(2)", "/mp3-zubehoer/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;
		
	};
};