var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Wasserionisierer_20Vollautomaten", "/wasserionisierer/index.html", 1, "", 1, "");
addItem("1004", "Alkalark_20_X7_20Aquastick_20Mobil", "/alkalark-aquastick-mobil/index.html", 1, "", 1, "");
addItem("1005", "6in1_20Vitamin_20C_20Ion_20Dusche", "/6in1-vitamin-c-ion-dusche/bionlite-vital-dusche.shtml", 1, "", 1, "");
addItem("10023", "Silber_20_X7_20Gold_20Pflege_20Seife", "/nano-silber-gold-pflege-seife/index.html", 1, "", 1, "");
addItem("1006", "B_C3_BCcher_20_X7_20DVDs", "/buecher-dvds/index.html", 1, "", 1, "");
addItem("10026", "Ersatzfilter", "/ersatzfilter/index.html", 1, "", 1, "");
addItem("10025", "Zubeh_C3_B6r_20_X7_20Ersatzteile", "/nuetzliches-zubehoer/index.html", 1, "", 1, "");
addItem("1007", "Sonderangebote", "/top-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;
		
	};
};