var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10010", "GUTSCHEINE", "/gutscheine/gutschein.html", 1, "", 1, "");
addItem("1008", "SOLEUM_X2BASIC_20BAUSATZ", "/soleum-basic-bausatz/index.html", 1, "", 1, "");
addItem("1005", "Vernebelungstechnik", "/vernebelungstechnik/index.html", 1, "", 1, "");
addItem("1002", "Dampfgeneratoren", "/dampfgeneratoren/index.html", 1, "", 1, "");
addItem("10012", "Dampfgeneratoren_20KS_X2Serie", "/dampfgeneratoren/dampfgeneratoren-ks-serie/index.html", 2, "", 1, "");
addItem("1001", "Farblichtlampen", "/farblicht/index_farblicht.html", 1, "", 1, "");
addItem("1003", "Heizmatten_20f_C3_BCr_20Dampfb_C3_A4der", "/heizmatten-fuer-dampfbaeder/index.html", 1, "", 1, "");
addItem("1004", "Heizungsregler", "/heizungsregler/index.html", 1, "", 1, "");
addItem("1006", "Dampfbad_X2Leuchten", "/dampfbad-leuchten/index.html", 1, "", 1, "");
addItem("1007", "Dampfbad_20Zubeh_C3_B6r", "/dampfbadzubehoer/index.html", 1, "", 1, "");
addItem("10011", "Leuchten_20Au_C3_9Fenbereich", "/leuchten-aussenbereich/leuchten-aussenbereich.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;
		
	};
};