var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1003", "Digitalreceiver", "/digitalreceiver/index.html", 1, "", 1, "");
addItem("1002", "DBox2_20_X2_20Kabel", "/digitalreceiver/dbox2-kabel/index.html", 2, "", 1, "");
addItem("1006", "DBox2_20_X2_20Sat", "/digitalreceiver/dbox2-sat/index.html", 2, "", 1, "");
addItem("1007", "DBox2_X2Tuning", "/dbox2-tuning/index.html", 1, "", 1, "");
addItem("10011", "IDE_X2Interface", "/ide-interface/index.html", 1, "", 1, "");
addItem("10027", "Festplatten", "/festplatten/index.html", 1, "", 1, "");
addItem("10031", "2_X35_22_20IDE", "/festplatten/25-ide/index.html", 2, "", 1, "");
addItem("10033", "2_X35_22_20SATA", "/festplatten/25-sata/index.html", 2, "", 1, "");
addItem("10017", "Zubeh_C3_B6r", "/zubehoer/index.html", 1, "", 1, "");
addItem("1001", "Anschlu_C3_9Fkabel_20und_20Adapter", "/zubehoer/anschlusskabel-und-adapter/index.html", 2, "", 1, "");
addItem("10010", "Netzwerkzubeh_C3_B6r", "/zubehoer/netzwerkzubehoer/index.html", 2, "", 1, "");
addItem("10020", "Werkzeug", "/zubehoer/werkzeug/index.html", 2, "", 1, "");
addItem("10018", "Ersatzteile", "/ersatzteile/index.html", 1, "", 1, "");
addItem("1004", "Displays", "/ersatzteile/displays/index.html", 2, "", 1, "");
addItem("1008", "Fernbedienungen", "/ersatzteile/fernbedienungen/index.html", 2, "", 1, "");
addItem("10014", "Tuner", "/ersatzteile/tuner/index.html", 2, "", 1, "");
addItem("10015", "Geh_C3_A4useteile", "/ersatzteile/gehaeuseteile/index.html", 2, "", 1, "");
addItem("10021", "Netzteile", "/ersatzteile/netzteile/index.html", 2, "", 1, "");
addItem("10024", "diverse_20Chip_X9s_20und_20IC's", "/ersatzteile/diverse-chips-und-ics/index.html", 2, "", 1, "");
addItem("10026", "Kabel", "/ersatzteile/kabel/index.html", 2, "", 1, "");
addItem("10022", "Reparatur", "/reparatur/index.html", 1, "", 1, "");
addItem("10025", "Restposten", "/restposten/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;
		
	};
};