var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Luftgewehrmunition", "/pi1/index.html", 1, "", 1, "");
addItem("1002", "Zielfernrohre", "/pi2/index.html", 1, "", 1, "");
addItem("1003", "Red_20Dot_20Leuchpunktzielger_C3_A4te", "/pi3/index.html", 1, "", 1, "");
addItem("10035", "Zweibeine", "/pi35/index.html", 1, "", 1, "");
addItem("1005", "Laser_X2Entfernungsmesser", "/pi5/index.html", 1, "", 1, "");
addItem("1007", "Ferngl_C3_A4ser", "/pi7/index.html", 1, "", 1, "");
addItem("1004", "Kugelf_C3_A4nge", "/pi4/index.html", 1, "", 1, "");
addItem("1006", "Zielscheiben", "/pi4/pi6/index.html", 2, "", 1, "");
addItem("1008", "Bundeswehrartikel", "/pi8/index.html", 1, "", 1, "");
addItem("1009", "Waffenzubeh_C3_B6r", "/pi9/index.html", 1, "", 1, "");
addItem("10010", "Griffschalen", "/pi9/pi10/index.html", 2, "", 1, "");
addItem("10011", "Griffschalen_20Gaspistolen", "/pi9/pi10/pi11/index.html", 3, "", 1, "");
addItem("10012", "Holster", "/pi9/pi12/index.html", 2, "", 1, "");
addItem("10020", "Ersatzteile_20f_C3_BCr_20Luftgewehre", "/pi9/pi20/index.html", 2, "", 1, "");
addItem("10018", "Waffenpflege", "/pi18/index.html", 1, "", 1, "");
addItem("10024", "Paintballzubeh_C3_B6r", "/pi24/index.html", 1, "", 1, "");
addItem("10013", "Softair_X2Waffen", "/pi13/index.html", 1, "", 1, "");
addItem("10022", "Softair_20Munition", "/pi13/pi22/index.html", 2, "", 1, "");
addItem("10014", "Gewehrtaschen_20und_20Gewehrkoffer", "/pi14/index.html", 1, "", 1, "");
addItem("10015", "Messer", "/pi15/index.html", 1, "", 1, "");
addItem("10027", "Smith_X7Wesson", "/pi15/pi27/index.html", 2, "", 1, "");
addItem("10028", "Fantasy_20Messer", "/pi15/pi28/index.html", 2, "", 1, "");
addItem("10029", "Wurfmesser", "/pi15/pi29/index.html", 2, "", 1, "");
addItem("10030", "Brief_C3_B6ffner", "/pi15/pi30/index.html", 2, "", 1, "");
addItem("10031", "Dolche", "/pi15/pi31/index.html", 2, "", 1, "");
addItem("10032", "Survival_X2Messer", "/pi15/pi32/index.html", 2, "", 1, "");
addItem("10034", "Fahrtenmesser", "/pi15/pi34/index.html", 2, "", 1, "");
addItem("10016", "Handschellen", "/pi16/index.html", 1, "", 1, "");
addItem("10017", "Pfefferspray", "/pi17/index.html", 1, "", 1, "");
addItem("10019", "Taschenlampen", "/pi19/index.html", 1, "", 1, "");
addItem("10021", "Sonderangebote", "/pi21/index.html", 1, "", 1, "");
addItem("10023", "Security", "/pi23/index.html", 1, "", 1, "");
addItem("10025", "CO2_X2Kapseln", "/pi25/index.html", 1, "", 1, "");
addItem("10026", "Anh_C3_A4nger_X4Ketten", "/pi26/index.html", 1, "", 1, "");
addItem("10033", "Deko_X2Waffen", "/pi33/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;
		
	};
};