var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10045", "Elektroheizung", "/elektroheizung/index.html", 1, "", 1, "");
addItem("10018", "Badezimmer_X2Schnellheizer", "/elektroheizung/badezimmer-schnellheizer/index.html", 2, "", 1, "");
addItem("10038", "Bodenheizung", "/elektroheizung/bodenheizung/index.html", 2, "", 1, "");
addItem("1009", "Direktheizger_C3_A4te_20AKO", "/elektroheizung/direktheizgeraete-ako/index.html", 2, "", 1, "");
addItem("10011", "Frostw_C3_A4chter", "/elektroheizung/frostwaechter/index.html", 2, "", 1, "");
addItem("1005", "Handtuchtrockner", "/elektroheizung/handuchtrockner/index.html", 2, "", 1, "");
addItem("1008", "H_C3_A4ndetrockner", "/elektroheizung/haendetrockner/index.html", 2, "", 1, "");
addItem("1006", "Industrieheizger_C3_A4te", "/elektroheizung/industrieheizgeraete/index.html", 2, "", 1, "");
addItem("1004", "Konvektoren", "/elektroheizung/konvektoren/index.html", 2, "", 1, "");
addItem("10015", "Nachtspeicherheizung", "/elektroheizung/nachtspeicherheizung/index.html", 2, "", 1, "");
addItem("1003", "Natursteinheizung", "/elektroheizung/natursteinheitzung/index.html", 2, "", 1, "");
addItem("10010", "Strahler", "/elektroheizung/blockstrahler/index.html", 2, "", 1, "");
addItem("10042", "Thermostate", "/elektroheizung/thermostate/index.html", 2, "", 1, "");
addItem("10041", "Teilspeicherheizung", "/elektroheizung/flaechenheizung2/index.html", 2, "", 1, "");
addItem("10044", "Beispielpacket_20f_C3_BCr_2060_20m_C2_B2_20Wohnfl_C3_A4che", "/elektroheizung/flaechenheizung2/packetangebote/index.html", 3, "", 1, "");
addItem("10017", "Wandkonvektoren", "/elektroheizung/wandkonvektoren/index.html", 2, "", 1, "");
addItem("10016", "W_C3_A4rmewellenheizger_C3_A4te", "/elektroheizung/waermewellenheizgeraete/index.html", 2, "", 1, "");
addItem("10035", "Zubeh_C3_B6r", "/elektroheizung/zubehoer/index.html", 2, "", 1, "");
addItem("10047", "Elektroinstallation", "/elektroinstallation/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;
		
	};
};