var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "RC_20_X2_20Flugmodelle", "/rc-flugzeuge/index.html", 1, "", 1, "");
addItem("1005", "Ersatzteile_X4Zubeh_C3_B6r", "/rc-flugzeuge/zubehoer/index.html", 2, "", 1, "");
addItem("1001", "RC_20_X2_20Helicopter", "/helicopter/index.html", 1, "", 1, "");
addItem("10029", "Elektro_20Helicopter_20Micro_20RTF", "/helicopter/silverlit-micro-helicopter/index.html", 2, "", 1, "");
addItem("10030", "Elektro_20Helicopter_20RTF", "/helicopter/elektro-helicopter-rtf/index.html", 2, "", 1, "");
addItem("10031", "Elektro_20Helicopter_20Baus_C3_A4tze", "/helicopter/elektro-helicopter-bausaetze/index.html", 2, "", 1, "");
addItem("1006", "Ersatzteile_X4Zubeh_C3_B6r", "/helicopter/zubehoer/index.html", 2, "", 1, "");
addItem("1007", "Blade_20CX", "/helicopter/zubehoer/blade-cx/index.html", 3, "", 1, "");
addItem("10021", "Blade_20CX2", "/helicopter/zubehoer/blade-cx-2/index.html", 3, "", 1, "");
addItem("1008", "Blade_20CP", "/helicopter/zubehoer/blade-cp/index.html", 3, "", 1, "");
addItem("1009", "Blade_20CP_20pro", "/helicopter/zubehoer/blade-cp-pro/index.html", 3, "", 1, "");
addItem("10010", "Blade_20400_203D", "/helicopter/zubehoer/blade-400-3d/index.html", 3, "", 1, "");
addItem("10017", "Hurricane_20550_20V2", "/helicopter/zubehoer/hurricane-550-v2/index.html", 3, "", 1, "");
addItem("1003", "RC_20_X2_20Automodelle", "/rc-fahrzeuge/index.html", 1, "", 1, "");
addItem("10011", "Ersatzteile_X4Zubeh_C3_B6r", "/rc-fahrzeuge/ersatzteilezubehoer/index.html", 2, "", 1, "");
addItem("1004", "RC_20_X2_20Schiffsmodelle", "/rc-boote/index.html", 1, "", 1, "");
addItem("10012", "Ersatzteile_X4Zubeh_C3_B6r", "/rc-boote/ersatzteilezubehoer/index.html", 2, "", 1, "");
addItem("10013", "Elektronik", "/electronik/index.html", 1, "", 1, "");
addItem("10014", "Elektroantriebe", "/electronik/elektromotoren/index.html", 2, "", 1, "");
addItem("10015", "Regler", "/electronik/regler/index.html", 2, "", 1, "");
addItem("10016", "Ladeger_C3_A4te", "/electronik/ladegeraete/index.html", 2, "", 1, "");
addItem("10020", "RC_X2Anlagen_20_X4_20Servos_20_X4_20Kreisel", "/electronik/rc-anlagen/index.html", 2, "", 1, "");
addItem("10025", "Sender_20_X4_20Empf_C3_A4nger", "/electronik/rc-anlagen/sender/index.html", 3, "", 1, "");
addItem("10027", "Servos", "/electronik/rc-anlagen/servos/index.html", 3, "", 1, "");
addItem("10028", "Kreisel_20(_20Gyro_20)", "/electronik/rc-anlagen/kreisel-gyro/index.html", 3, "", 1, "");
addItem("10022", "Lithium_20Polymer_20Akkus", "/electronik/lithium-polymer-akkus/index.html", 2, "", 1, "");
addItem("10023", "Kong_20Power_20_X2_20Die_20neuen_20High_20End_20Lipo_20Zellen", "/electronik/lithium-polymer-akkus/kong-power/index.html", 3, "", 1, "");
addItem("10024", "EXTREME_20Power_20_X2_20Hohe_20Spannungslage,_20g_C3_BCnstiger_20Preis", "/electronik/lithium-polymer-akkus/extreme-power-hohe-spannungslage-guenstiger-preis/index.html", 3, "", 1, "");
addItem("10018", "Gutscheine", "/geschenkgutschein/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;
		
	};
};