var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Schlagpolster_20(9)", "/pi1/index.html", 1, "", 1, "");
addItem("1002", "Pratzen_20(13)", "/pi2/index.html", 1, "", 1, "");
addItem("1003", "Boxsack_20(15)", "/pi3/index.html", 1, "", 1, "");
addItem("10021", "Boxsack_20standard_20(9)", "/pi3/pi21/index.html", 2, "", 1, "");
addItem("10022", "Boxsack_20diverse_20(6)", "/pi3/pi22/index.html", 2, "", 1, "");
addItem("1004", "Boxhandschuhe_20(31)", "/pi4/index.html", 1, "", 1, "");
addItem("1005", "Boxhandschuhe_20Kunstleder_20(12)", "/pi4/pi5/index.html", 2, "", 1, "");
addItem("1009", "Freefight_20Handschuhe_20(3)", "/pi4/pi9/index.html", 2, "", 1, "");
addItem("1008", "Boxsack_X2Handschuhe_20(3)", "/pi4/pi8/index.html", 2, "", 1, "");
addItem("1006", "Boxhandschuhe_20Leder_20(11)", "/pi4/pi6/index.html", 2, "", 1, "");
addItem("10025", "Boxhandschuhe_20Schn_C3_BCrung_20(2)", "/pi4/pi25/index.html", 2, "", 1, "");
addItem("1007", "Mike_20Sport_20f_C3_BCr_20Kinder_20(3)", "/pi7/index.html", 1, "", 1, "");
addItem("10010", "Thaibox_20Shorts_20(41)", "/pi10/index.html", 1, "", 1, "");
addItem("10011", "Kickboxhosen_20(6)", "/pi11/index.html", 1, "", 1, "");
addItem("10012", "Box_20Shorts_20(2)", "/pi12/index.html", 1, "", 1, "");
addItem("10028", "Sportbekleidung_20(2)", "/pi28/index.html", 1, "", 1, "");
addItem("10014", "Zubeh_C3_B6r_20(21)", "/pi14/index.html", 1, "", 1, "");
addItem("10015", "Boxbandagen_20(14)", "/pi14/pi15/index.html", 2, "", 1, "");
addItem("10023", "Zubeh_C3_B6r_20Diverses_20(7)", "/pi14/pi23/index.html", 2, "", 1, "");
addItem("10017", "Schutzausr_C3_BCstung_20(32)", "/pi17/index.html", 1, "", 1, "");
addItem("10016", "Tiefschutz_20(2)", "/pi17/pi16/index.html", 2, "", 1, "");
addItem("10013", "Schienbeinschutz_20(6)", "/pi17/pi13/index.html", 2, "", 1, "");
addItem("10018", "Mundschutz_20(7)", "/pi17/pi18/index.html", 2, "", 1, "");
addItem("10024", "Kopfschutz_20(7)", "/pi17/pi24/index.html", 2, "", 1, "");
addItem("10026", "Diverse_20Schutzausr_C3_BCstung_20(10)", "/pi17/pi26/index.html", 2, "", 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;
		
	};
};