var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "HAM_20Radio", "/amateurfunkgeraete/index.html", 1, "", 1, "");
addItem("1002", "Handfunkger_C3_A4te", "/amateurfunkgeraete/handfunkgeraete/index.html", 2, "", 1, "");
addItem("1009", "Mobilfunkger_C3_A4te", "/amateurfunkgeraete/mobilfunkgeraete/index.html", 2, "", 1, "");
addItem("10010", "Stationsger_C3_A4te", "/amateurfunkgeraete/stationsgeraete/index.html", 2, "", 1, "");
addItem("1005", "Marine_20Radios", "/seefunkgeraete/index.html", 1, "", 1, "");
addItem("1003", "PMR_20Radios", "/betriebsfunkgeraete/index.html", 1, "", 1, "");
addItem("1004", "Receiver", "/empfaenger/index.html", 1, "", 1, "");
addItem("1007", "Airband_20Radios", "/flugfunkgeraete/index.html", 1, "", 1, "");
addItem("10011", "PMR446_20Radios", "/pmr446-funkgeraete/index.html", 1, "", 1, "");
addItem("1008", "Rotoren", "/rotoren/index.html", 1, "", 1, "");
addItem("1006", "Zubeh_C3_B6r", "/zubehoer/index.html", 1, "", 1, "");
addItem("10023", "Antennen_20und_20Zubeh_C3_B6r", "/zubehoer/antennentuner/index.html", 2, "", 1, "");
addItem("10025", "Antennen", "/zubehoer/antennentuner/antennen/index.html", 3, "", 1, "");
addItem("10026", "Antennen_X2Zubeh_C3_B6r", "/zubehoer/antennentuner/antennen-zubehoer/index.html", 3, "", 1, "");
addItem("10020", "Rotoren_20Zubeh_C3_B6r", "/zubehoer/antennentuner/mastoberlager-und-klemmbacken/index.html", 3, "", 1, "");
addItem("10022", "Filter_20und_20Module", "/zubehoer/module/index.html", 2, "", 1, "");
addItem("10012", "Filter", "/zubehoer/module/filter/index.html", 3, "", 1, "");
addItem("10027", "Module", "/zubehoer/module/module/index.html", 3, "", 1, "");
addItem("10021", "Kabel_20und_20Stecker", "/zubehoer/kabel-und-stecker/index.html", 2, "", 1, "");
addItem("10013", "Mikrofone_20und_20Headsets", "/zubehoer/mikrofone-und-headsets/index.html", 2, "", 1, "");
addItem("10014", "Handmikrofone", "/zubehoer/mikrofone-und-headsets/handmikrofone/index.html", 3, "", 1, "");
addItem("10015", "Standmikrofone", "/zubehoer/mikrofone-und-headsets/standmikrofone/index.html", 3, "", 1, "");
addItem("10016", "Headsets", "/zubehoer/mikrofone-und-headsets/headsets/index.html", 3, "", 1, "");
addItem("10017", "Netzger_C3_A4te_20und_20Ladeger_C3_A4te", "/zubehoer/netzgeraete/index.html", 2, "", 1, "");
addItem("10028", "Netzger_C3_A4te", "/zubehoer/netzgeraete/netzgeraete/index.html", 3, "", 1, "");
addItem("10029", "Ladeger_C3_A4te", "/zubehoer/netzgeraete/ladegeraete/index.html", 3, "", 1, "");
addItem("10019", "Separations_X2Kits", "/zubehoer/separations-kits/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;
		
	};
};