var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "Saunazubeh_C3_B6r", "/saunazubehoer/saunazubehour.htm", 1, "", 1, "");
addItem("10065", "Klimamesser_20und_20Thermometer", "/saunazubehoer/klimameser-und-thermometer/index.htm", 2, "", 1, "");
addItem("10066", "Sanduhren_20und_20Zeitmesser", "/saunazubehoer/sanduhren-und-zeitmesser/index.htm", 2, "", 1, "");
addItem("10067", "Aufgusszubeh_C3_B6r", "/saunazubehoer/aufgusszubehoer/index.htm", 2, "", 1, "");
addItem("1001", "Diverses_20Zubeh_C3_B6r_20Sauna", "/saunazubehoer/zubehoer-sauna-vitalbad/index.htm", 2, "", 1, "");
addItem("10060", "Sauna", "/sauna/index.htm", 1, "", 1, "");
addItem("1005", "Elementsaunen", "/elementsaunen/index.htm", 2, "", 1, "");
addItem("10033", "Infrarot_X2W_C3_A4rmekabinen", "/infrarot-waermekabinen/index.htm", 2, "", 1, "");
addItem("10023", "Massivholzsaunen", "/massivholzsaunen/index.htm", 2, "", 1, "");
addItem("10064", "Kataloge_20gratis", "/sauna-kataloge/index.htm", 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;
		
	};
};