var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Sicherheit_20f_C3_BCr_20Zuhause", "/pi1/index.htm", 1, "", 1, "");
addItem("1005", "Nachf_C3_BCllartikel", "/pi1/pi5/index.htm", 2, "", 1, "");
addItem("1002", "Sicherheit_20f_C3_BCr_20Kinder", "/pi2/index.htm", 1, "", 1, "");
addItem("1006", "Sicherheit_20f_C3_BCr_20Unterwegs", "/pi6/index.htm", 1, "", 1, "");
addItem("1007", "Sicherheitsbekleidung", "/pi7/index.htm", 1, "", 1, "");
addItem("1008", "MC_20Allister_20black", "/pi7/pi8/index.htm", 2, "", 1, "");
addItem("10010", "Mc_20Allister_20black_20mit_20Rei_C3_9Fverschluss", "/pi7/pi10/index.htm", 2, "", 1, "");
addItem("10011", "Mc_20Allister_20camo", "/pi7/pi11/index.htm", 2, "", 1, "");
addItem("10012", "Mc_20Allister_20desert", "/pi7/pi12/index.htm", 2, "", 1, "");
addItem("10013", "Security_X2Einsatzstiefel", "/pi7/pi13/index.htm", 2, "", 1, "");
addItem("10014", "Security_X2Einsatzstiefel_20wasserdicht", "/pi7/pi14/index.htm", 2, "", 1, "");
addItem("10015", "Durchsuchungshandschuhe_20mit_20Kevlar", "/pi7/pi15/index.htm", 2, "", 1, "");
addItem("10016", "Durchsuchungshandschuhe", "/pi7/pi16/index.htm", 2, "", 1, "");
addItem("10017", "SWAT_20Handschuhe", "/pi7/pi17/index.htm", 2, "", 1, "");
addItem("10018", "SWAT_20Handschuhe_20offen", "/pi7/pi18/index.htm", 2, "", 1, "");
addItem("10019", "Security_X2Cap", "/pi7/pi19/index.htm", 2, "", 1, "");
addItem("10020", "Personenschutz", "/pi20/index.htm", 1, "", 1, "");
addItem("10021", "Nachf_C3_BCllartikel", "/pi20/pi21/index.htm", 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;
		
	};
};