var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10028", "Angebote_20des_20Monats", "/angebot-des-monats/index.html", 1, "", 1, "");
addItem("1004", "Asiakochger_C3_A4te", "/asiakochgeraete/index.html", 1, "", 1, "");
addItem("1003", "Aufschnittmaschinen", "/aufschnittmaschinen/index.html", 1, "", 1, "");
addItem("1007", "Chafing_20Dishes", "/chafing-dishes/index.html", 1, "", 1, "");
addItem("10098", "Dispenser", "/dispenser/index.html", 1, "", 1, "");
addItem("10027", "Fritteusen", "/fritteusen/index.html", 1, "", 1, "");
addItem("10056", "Tischfritteuse_20GAS", "/fritteusen/tischfritteuse-gas/index.html", 2, "", 1, "");
addItem("10057", "Standfritteuse_20ELEKTRO", "/fritteusen/standfritteuse-elektro/index.html", 2, "", 1, "");
addItem("10058", "Standfritteuse_20GAS", "/fritteusen/standfritteuse-gas/index.html", 2, "", 1, "");
addItem("10059", "Zubeh_C3_B6r", "/fritteusen/zubehoer/index.html", 2, "", 1, "");
addItem("10031", "G_C3_A4rschr_C3_A4nke", "/gaerschraenke/index.html", 1, "", 1, "");
addItem("10015", "Kaffeemaschinen", "/kaffeemaschinen/index.html", 1, "", 1, "");
addItem("10099", "Zubeh_C3_B6r", "/kaffeemaschinen/zubehoer/index.html", 2, "", 1, "");
addItem("10042", "Kombid_C3_A4mpfer", "/kombidaempfer/index.html", 1, "", 1, "");
addItem("10030", "Kontaktgrills", "/kontaktgrills/index.html", 1, "", 1, "");
addItem("10096", "Regale", "/regale/index.html", 1, "", 1, "");
addItem("100100", "Sauberkeit_20_X7_20Hygiene", "/sauberkeit-hygiene/index.html", 1, "", 1, "");
addItem("100112", "Transportwagen", "/gn-transportwagen/index.html", 1, "", 1, "");
addItem("100110", "Waagen", "/waagen/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;
		
	};
};