var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10032", "Aroma_C3_B6le", "/http://www.aromaportal.ch/aromaoele/index.html", 1, "", 1, "_self");
addItem("10033", "_C3_84therische_20_C3_96le", "/http://www.aromaportal.ch/aetherische-oele/index.html", 1, "", 1, "_self");
addItem("10037", "Sauna_C3_B6le", "/http://www.aromaportal.ch/saunaoele/index.html", 1, "", 1, "_self");
addItem("10038", "Duftkerzen", "/http://www.aromaportal.ch/dufkerzen/index.html", 1, "", 1, "_self");
addItem("10039", "Duftkerzen_20Standard", "/http://www.aromaportal.ch/dufkerzen/duftkerzen-standard/index.html", 2, "", 1, "_self");
addItem("10040", "Duftkerzen_20DecoLine", "/http://www.aromaportal.ch/dufkerzen/duftkerzen-decoline/index.html", 2, "", 1, "_self");
addItem("10041", "Duftkerzen_20W_C3_BCrfelLine", "/http://www.aromaportal.ch/dufkerzen/wuerfelline/index.html", 2, "", 1, "_self");
addItem("10042", "Duftkerzen_20CandleLine", "/http://www.aromaportal.ch/dufkerzen/candleline/index.html", 2, "", 1, "_self");
addItem("10035", "Duftlampen", "/http://www.aromaportal.ch/duftlampen/index.html", 1, "", 1, "_self");
addItem("10034", "Produkteinformationen", "/http://www.aromaportal.ch/produkteinformationen/index.html", 1, "", 1, "_self");
addItem("10031", "Weihnachtskarten", "/http://www.weihnachtskartenshop.ch", 1, "", 1, "_blank");
addItem("10013", "Kalender", "/http://www.kalenderproduktion.ch", 1, "", 1, "_blank");
};

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;
		
	};
};