var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "CB_X2Handfunkger_C3_A4te_20(4)", "/pi1/index.html", 1, "", 1, "");
addItem("10014", "CB_X2Mobilfunk_20Alan_X4Midland_20(4)", "/pi14/index.html", 1, "", 1, "");
addItem("10015", "CB_X2Mobilfunk_20Albrecht_20(6)", "/pi15/index.html", 1, "", 1, "");
addItem("10016", "CB_X2Mobilfunk_20Intek_20(6)", "/pi16/index.html", 1, "", 1, "");
addItem("10017", "CB_X2Mobilfunk_20Maxon_20(1)", "/pi17/index.html", 1, "", 1, "");
addItem("10018", "CB_X2Mobilfunk_20President_20(4)", "/pi18/index.html", 1, "", 1, "");
addItem("10019", "CB_X2Mobilfunk_20Stabo_20(6)", "/pi19/index.html", 1, "", 1, "");
addItem("10020", "CB_X2Mobilfunkger_C3_A4t_20TTI_20(3)", "/pi20/index.html", 1, "", 1, "");
addItem("1003", "CB_X2Mobilfunk_20Team_20(2)", "/pi3/index.html", 1, "", 1, "");
addItem("1005", "CB_20Heimstationen_20(2)", "/pi5/index.html", 1, "", 1, "");
addItem("1009", "Gebrauchtger_C3_A4te_20(2)", "/pi9/index.html", 1, "", 1, "");
addItem("10011", "Exportger_C3_A4te_20(1)", "/pi11/index.html", 1, "", 1, "");
addItem("1002", "PMR_20Funkger_C3_A4te_20(2)", "/pi2/index.html", 1, "", 1, "");
addItem("1004", "PMR_20Zubeh_C3_B6r_20(2)", "/pi4/index.html", 1, "", 1, "");
addItem("10010", "Zusatzlautsprecher_20(2)", "/pi10/index.html", 1, "", 1, "");
addItem("10012", "Scanner,_20Empf_C3_A4nger_20(2)", "/pi12/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;
		
	};
};