var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10036", "Filialen", "/anfahrt.php", 1, "", 1, "_self");
addItem("10017", "Termine_X4News", "/events-veranstaltungen.php", 1, "", 1, "_self");
addItem("1005", "Neumotorr_C3_A4der", "/neumotorraeder/index.html", 1, "", 1, "");
addItem("1001", "Aprilia", "/neumotorraeder/aprilia/index.html", 2, "", 1, "");
addItem("10025", "Aprilia_20Scooter_20_X7gt_X8_20125", "/neumotorraeder/aprilia/roller/index.html", 3, "", 1, "");
addItem("10024", "Aprilia_X250cm_C2_B3", "/neumotorraeder/aprilia/50er/index.html", 3, "", 1, "");
addItem("1007", "Benelli", "/neumotorraeder/benelli/index.html", 2, "", 1, "");
addItem("10014", "Yamaha", "/neumotorraeder/yamaha/index.html", 2, "", 1, "");
addItem("10028", "Racing_20Yamaha", "/neumotorraeder/yamaha/yamaha-sport/index.html", 3, "", 1, "");
addItem("10041", "Touring_20Yamaha", "/neumotorraeder/yamaha/yamaha-touring/index.html", 3, "", 1, "");
addItem("10042", "Chopper_20Yamaha", "/neumotorraeder/yamaha/chopper-yamaha/index.html", 3, "", 1, "");
addItem("10044", "Enduro_20Yamaha", "/neumotorraeder/yamaha/enduro-yamaha/index.html", 3, "", 1, "");
addItem("10045", "Scooter_20Yamaha", "/neumotorraeder/yamaha/scooter-yamaha/index.html", 3, "", 1, "");
addItem("10026", "125cm_C2_B3_20Yamaha", "/neumotorraeder/yamaha/yamaha-125/index.html", 3, "", 1, "");
addItem("10037", "Yamaha_X250_20cm_C2_B3", "/neumotorraeder/yamaha/yamaha-moped/index.html", 3, "", 1, "");
addItem("10016", "Suzuki", "/neumotorraeder/suzuki/index.html", 2, "", 1, "");
addItem("10038", "Chopper_X2Suzuki", "/neumotorraeder/suzuki/chopper-suzuki/index.html", 3, "", 1, "");
addItem("10039", "Enduro_X2Suzuki", "/neumotorraeder/suzuki/enduro/index.html", 3, "", 1, "");
addItem("10040", "Racing_X2Suzuki", "/neumotorraeder/suzuki/racing-suzuki/index.html", 3, "", 1, "");
addItem("10043", "Naked_X4Sport_X2Suzuki", "/neumotorraeder/suzuki/nakedsport-suzuki/index.html", 3, "", 1, "");
addItem("10046", "Scooter_20Suzuki", "/neumotorraeder/suzuki/scooter-suzuki/index.html", 3, "", 1, "");
addItem("10070", "Suzuki_X2News", "/seite-nicht-gefunden-404.html", 3, "", 1, "");
addItem("10027", "SYM", "/neumotorraeder/sym/index.html", 2, "", 1, "");
addItem("10010", "Gebrauchte_20Motorr_C3_A4der", "/gebrauchte-motorraeder/index.php", 1, "", 1, "_self");
addItem("10030", "GM_20Abo", "/gm-auftrag.php", 2, "", 1, "_self");
addItem("1006", "Zubeh_C3_B6r", "/bekleidung-helme/index.html", 1, "", 1, "");
addItem("10049", "Aprilia_20Bekleidung", "/bekleidung-helme/aprilia-bekleidung-original/index.html", 2, "", 1, "");
addItem("10050", "Benelli_20Bekleidung", "/bekleidung-helme/benelli-bekleidung-original/index.html", 2, "", 1, "");
addItem("10069", "Alle_20Scooter_20ab_2051cm_C2_B3", "/scooter-alle-124/index.html", 1, "", 1, "");
addItem("10022", "125er", "/125er/index.html", 1, "", 1, "");
addItem("10020", "Moped_2050cm_C2_B3", "/neumotorraeder/moped-50cm/index.html", 1, "", 1, "");
addItem("10019", "Motorhispania_2050cm", "/neumotorraeder/motorhispania-50cm/index.html", 2, "", 1, "");
addItem("10035", "Aprilia_X250cm_C2_B3", "/neumotorraeder/moped-50cm/aprilia-moped/index.html", 2, "", 1, "");
addItem("10066", "Yamaha_20Moped", "/neumotorraeder/yamaha/yamaha-moped/index.html", 2, "", 1, "");
addItem("10067", "SYM_X250", "/neumotorraeder/moped-50cm/sym-50/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;
		
	};
};