var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "B_C3_BCschelstecker_20(15)", "/pi2/index.php", 1, "", 1, "");
addItem("1009", "Edelstahlstecker_20(4)", "/pi2/pi9/index.php", 2, "", 1, "");
addItem("1008", "Buchsen_20(11)", "/pi8/index.php", 1, "", 1, "");
addItem("10010", "Edelstahlbuchsen_20(1)", "/pi8/pi10/index.php", 2, "", 1, "");
addItem("10014", "Sicherheitsbuchsen_20(8)", "/pi8/pi14/index.php", 2, "", 1, "");
addItem("1003", "Federkorbstecker_20(2)", "/pi3/index.php", 1, "", 1, "");
addItem("1001", "Messleitungen_20(30)", "/pi1/index.php", 1, "", 1, "");
addItem("10016", "Kabel_20(13)", "/pi1/pi16/index.php", 2, "", 1, "");
addItem("1005", "Baus_C3_A4tze_20(2)", "/pi1/pi5/index.php", 2, "", 1, "");
addItem("1006", "Zubeh_C3_B6r_20(8)", "/pi1/pi6/index.php", 2, "", 1, "");
addItem("1007", "Modellbau_20(22)", "/pi7/index.php", 1, "", 1, "");
addItem("10013", "Modellbaukabel_20(13)", "/pi7/pi13/index.php", 2, "", 1, "");
addItem("10011", "Modellbaustecker_20(8)", "/pi7/pi11/index.php", 2, "", 1, "");
addItem("10012", "Zubeh_C3_B6r_20(1)", "/pi7/pi12/index.php", 2, "", 1, "");
addItem("10015", "Restposten_20(2)", "/pi15/index.php", 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;
		
	};
};