var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1007", "MG_20A_20(6)", "/pi7/index.html", 1, "", 1, "");
addItem("1002", "Getriebe_20und_20Getriebeteile", "/pi7/pi2/index.html", 2, "", 1, "");
addItem("1008", "Karosserieteile_20(4)", "/pi7/pi8/index.html", 2, "", 1, "");
addItem("10020", "Innenteile", "/pi7/pi20/index.html", 2, "", 1, "");
addItem("10025", "Motore_20und_20Motorenteile_20(1)", "/pi7/pi25/index.html", 2, "", 1, "");
addItem("10014", "MG_20A_20TWIN_20CAM_20(5)", "/pi14/index.html", 1, "", 1, "");
addItem("1006", "Getriebe_20und_20Getriebeteile", "/pi14/pi6/index.html", 2, "", 1, "");
addItem("10013", "Karosserieteile", "/pi14/pi13/index.html", 2, "", 1, "");
addItem("10019", "Innenteile", "/pi14/pi19/index.html", 2, "", 1, "");
addItem("10023", "Motore_20und_20Motorenteile_20(4)", "/pi14/pi23/index.html", 2, "", 1, "");
addItem("10021", "MG_20B_20(9)", "/pi21/index.html", 1, "", 1, "");
addItem("1003", "Getriebe_20und_20Getriebeteile", "/pi21/pi3/index.html", 2, "", 1, "");
addItem("1009", "Karosserieteile_20(3)", "/pi21/pi9/index.html", 2, "", 1, "");
addItem("10016", "Innenteile_20(1)", "/pi21/pi16/index.html", 2, "", 1, "");
addItem("10027", "Motore_20und_20Motorenteile_20(1)", "/pi21/pi27/index.html", 2, "", 1, "");
addItem("10022", "MG_20B_20V8_20(7)", "/pi22/index.html", 1, "", 1, "");
addItem("1001", "Getriebe_20und_20Getriebeteile", "/pi22/pi1/index.html", 2, "", 1, "");
addItem("10012", "Karosserieteile", "/pi22/pi12/index.html", 2, "", 1, "");
addItem("10015", "Innenteile", "/pi22/pi15/index.html", 2, "", 1, "");
addItem("10028", "Motore_20und_20Motorenteile", "/pi22/pi28/index.html", 2, "", 1, "");
addItem("10032", "MG_20RV8_20(1)", "/pi32/index.html", 1, "", 1, "");
addItem("10033", "Getriebe_20und_20Getriebeteile", "/pi32/pi33/index.html", 2, "", 1, "");
addItem("10034", "Karosserieteile", "/pi32/pi34/index.html", 2, "", 1, "");
addItem("10035", "Innenteile", "/pi32/pi35/index.html", 2, "", 1, "");
addItem("10036", "Motore_20und_20Motorenteile", "/pi32/pi36/index.html", 2, "", 1, "");
addItem("10031", "sonstige_20Teile", "/pi31/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;
		
	};
};