var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10029", "Tipps_20_X7_20Tricks", "/tipps-tricks/index.html", 1, "", 1, "");
addItem("10080", "Lepton", "/tipps-tricks/lepton/index.html", 2, "", 1, "");
addItem("10032", "SDX_2050", "/tipps-tricks/sdx-50/index.html", 2, "", 1, "");
addItem("10033", "Freya_20_X4_20EAGLE_203", "/tipps-tricks/freya-evo-freya-ex/index.html", 2, "", 1, "");
addItem("10035", "Turbulence_20D3", "/tipps-tricks/turbulence/index.html", 2, "", 1, "");
addItem("10062", "Special_20Models", "/special-models/index.html", 1, "", 1, "");
addItem("10060", "Flying_20Team", "/extra/index.html", 1, "", 1, "");
addItem("10091", "Team_20Diary", "/team-blog/index.html", 1, "", 1, "");
addItem("10079", "Ask_20our_20Team", "/help-desk/index.html", 1, "", 1, "");
addItem("10030", "Events", "/berichte/index.html", 1, "", 1, "");
addItem("10090", "1_X3_20Hirobo_20Helitreffen_202010", "/berichte/1-hirobo-helitreffen-2010/index.html", 2, "", 1, "");
addItem("10093", "3_X3_20Teilwettbewerb_20DM_20F3C_202010", "/berichte/3-teilwettbewerb-dm-f3c-2010/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;
		
	};
};