var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10021", "Tafel_20u_X3_20Landwein", "/pi21/index.html", 1, "", 1, "");
addItem("10020", "Hochgew_C3_A4chs", "/pi20/index.html", 1, "", 1, "");
addItem("10015", "Burg_C2_B4s_20Rivaner", "/pi15/index.html", 1, "", 1, "");
addItem("1004", "Literwein_20Wei_C3_9F_20u_X3_20Rot", "/pi4/index.html", 1, "", 1, "");
addItem("10017", "Kabinettweine", "/pi17/index.html", 1, "", 1, "");
addItem("10018", "Sp_C3_A4tleseweine", "/pi18/index.html", 1, "", 1, "");
addItem("10019", "Ausleseweine", "/pi19/index.html", 1, "", 1, "");
addItem("1001", "Beerenauslese_20u_X3_20Eiswein", "/pi2/pi1/index.html", 1, "", 1, "");
addItem("10011", "Traubensaft_20und_20Lik_C3_B6r", "/pi11/index.html", 1, "", 1, "");
addItem("10014", "Hochprozentiges", "/pi14/index.html", 1, "", 1, "");
addItem("1005", "Diabetikerwein", "/pi5/index.html", 1, "", 1, "");
addItem("1007", "Chardonnay", "/pi7/index.html", 1, "", 1, "");
addItem("1008", "Rotwein,_20Ros_C3_A9,_20Rotling", "/pi8/index.html", 1, "", 1, "");
addItem("1009", "Sekt_20und_20Secco", "/pi9/index.html", 1, "", 1, "");
addItem("10012", "Zum_20Essen_20und_20Kochen", "/pi12/index.html", 1, "", 1, "");
addItem("10013", "Gl_C3_BChwein", "/pi13/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;
		
	};
};