var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1003", "Ersatzteile", "/dl_zubehoer/index.html", 1, "", 1, "");
addItem("1004", "Armaturen", "/armaturen/index.html", 1, "", 1, "");
addItem("1005", "Druckbeh_C3_A4lter_20_X1_20Zubeh_C3_B6r", "/druckbehaelter-zubehoer/index.html", 1, "", 1, "");
addItem("1006", "Druckluftwerkzeuge_20_X4_20Ger_C3_A4te_20_X4_20Werkstatt", "/druckluftwerkzeuge-geraete-werkstatt/index.html", 1, "", 1, "");
addItem("1007", "Element_20_X2_20Druckschalter", "/element-druckschalter/index.html", 1, "", 1, "");
addItem("1008", "Heiz_X2_20und_20Reinigungstechnik", "/heiz-und-reinigungstechnik/index.html", 1, "", 1, "");
addItem("1009", "Hydraulik", "/hydraulik/index.html", 1, "", 1, "");
addItem("10010", "Kolbenkompressoren", "/kolbenkompressoren/index.html", 1, "", 1, "");
addItem("10011", "Kondensataufbereitung", "/kondensataufbereitung/index.html", 1, "", 1, "");
addItem("10012", "K_C3_A4ltetrockner_20_X1_20Zubeh_C3_B6r", "/kaeltetrockner-zubehoer/index.html", 1, "", 1, "");
addItem("10013", "Me_C3_9F_X2und_20Regelkomponenten", "/mess-und-regelkomponenten/index.html", 1, "", 1, "");
addItem("10014", "Pneumatik", "/pneumatik/index.html", 1, "", 1, "");
addItem("10015", "Rohrleitungssysteme", "/rohrleitungssysteme/index.html", 1, "", 1, "");
addItem("10016", "Schl_C3_A4uche_20_X1_20Zubeh_C3_B6r", "/schlaeuche-zubehoer/index.html", 1, "", 1, "");
addItem("10017", "Schraubenkompressoren", "/schraubenkompressoren/index.html", 1, "", 1, "");
addItem("10018", "Sonstige_20Kompressoren", "/sonstige-kompressoren/index.html", 1, "", 1, "");
addItem("10019", "Vakuumtechnik", "/vakuumtechnik/index.html", 1, "", 1, "");
addItem("10020", "Wartungsteile", "/wartungsteile/index.html", 1, "", 1, "");
addItem("10021", "Zu_X2_20und_20Ablufttechnik", "/zu-und-ablufttechnik/index.html", 1, "", 1, "");
addItem("10022", "Gebrauchtanlagen", "/gebrauchtanlagen/index.html", 1, "", 1, "");
addItem("10023", "Restposten", "/restposten/index.html", 1, "", 1, "");
addItem("10024", "Angebote", "/angebote/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;
		
	};
};