var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("100252", "NEU_20IM_20SHOP", "/neu-im-shop/index.php", 1, "", 1, "");
addItem("1002", "Kaltschaummatratze", "/kaltschaum-matratzen/index.php", 1, "", 1, "");
addItem("1003", "Taschenfederkernmatratze", "/taschenfederkern-matratzen/index.php", 1, "", 1, "");
addItem("1004", "Matratzen_20H_C3_A4rtegrad_204_20_X7_205", "/matratzen-haertegrad-4-5/index.php", 1, "", 1, "");
addItem("1005", "Visco_X2_20_X4_20Latexmatratzen", "/visco-latexmatratzen/index.php", 1, "", 1, "");
addItem("1006", "Federkern_20Matratzen", "/federkern-matratzen/index.php", 1, "", 1, "");
addItem("1007", "Lattenroste", "/lattenroste/index.php", 1, "", 1, "");
addItem("100224", "Bauchschl_C3_A4fer_20Matratzen", "/bauchschlaefer-matratzen/index.php", 1, "", 1, "");
addItem("100250", "Testsieger_20Matratzen", "/testsieger-matratzen/index.php", 1, "", 1, "");
addItem("100251", "Topper_20(Matratzen_X2Auflagen)", "/topper-matratzen-auflagen/index.php", 1, "", 1, "");
addItem("100253", "Kinderbett_X2Matratzen_2070x140_20und_2060x120_20cm", "/kinderbett-matratzen-70x140-und-60x120-cm/index.php", 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;
		
	};
};