var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10012", "Fotozubeh_C3_B6r", "/pi12/index.html", 1, "", 1, "");
addItem("1003", "Polarisationsfilter_20EMORA_20(9)", "/pi12/pi3/index.html", 2, "", 1, "");
addItem("1007", "Nahlinsen_20Set_20EMORA_20(7)", "/pi12/pi7/index.html", 2, "", 1, "");
addItem("10020", "Nahlinse_20_X110_20(5)", "/pi12/pi20/index.html", 2, "", 1, "");
addItem("10015", "Filterkit_20(CPL,_20UV_20und_20Nahlinse_20_X18)_20(11)", "/pi12/pi15/index.html", 2, "", 1, "");
addItem("1004", "Weitwinkelkonverter_20EMORA_20(4)", "/pi12/pi4/index.html", 2, "", 1, "");
addItem("1005", "Step_20Up_20Ringe_20(28)", "/pi12/pi5/index.html", 2, "", 1, "");
addItem("10021", "Step_20Down_20Ringe_20(8)", "/pi12/pi21/index.html", 2, "", 1, "");
addItem("1001", "Elektronenblitzger_C3_A4te_20TumaxDPT386AFZ_20(5)", "/pi12/pi1/index.html", 2, "", 1, "");
addItem("1002", "Elektronenblitzger_C3_A4te_20Tumax_20DSL880AFZ_20(5)", "/pi12/pi2/index.html", 2, "", 1, "");
addItem("10022", "Dia_20Duplikator_20(1)", "/pi12/pi22/index.html", 2, "", 1, "");
addItem("10023", "Weitwinkelkonverter_20f_C3_BCr_20DSLR_20(1)", "/pi12/pi23/index.html", 2, "", 1, "");
addItem("10024", "Makroblitzger_C3_A4te_20(3)", "/pi12/pi24/index.html", 2, "", 1, "");
addItem("10016", "Zum_20Fussballspielen_20f_C3_BCr_20Kinder", "/pi16/index.html", 1, "", 1, "");
addItem("10014", "Fussballtrikots_20f_C3_BCr_20Kinder_20(13)", "/pi16/pi14/index.html", 2, "", 1, "");
addItem("10018", "Torh_C3_BCter_20_X4_20Torwart_20(1)", "/pi16/pi18/index.html", 2, "", 1, "");
addItem("10019", "Fussballstulpen_20(1)", "/pi16/pi19/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;
		
	};
};