var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Lasermodule", "/pi1/index.php", 1, "", 1, "");
addItem("10011", "Lasermodule_20ROT_20(640nm)", "/pi1/pi11/index.php", 2, "", 1, "");
addItem("1002", "Lasermodule_20GR_C3_9CN_20(532nm)", "/pi1/pi2/index.php", 2, "", 1, "");
addItem("1004", "Lasermodule_20BLAU_20(473nm)", "/pi1/pi4/index.php", 2, "", 1, "");
addItem("1009", "Lasermodule_20BLAU_20(445nm)", "/pi1/pi9/index.php", 2, "", 1, "");
addItem("10010", "Lasermodule_20(RGB)", "/pi1/pi10/index.php", 2, "", 1, "");
addItem("1005", "Laserzubeh_C3_B6r", "/pi5/index.php", 1, "", 1, "");
addItem("1006", "Dichros", "/pi5/pi6/index.php", 2, "", 1, "");
addItem("1007", "Scanner", "/pi5/pi7/index.php", 2, "", 1, "");
addItem("10014", "ILDA_20Kabel", "/pi5/pi14/index.php", 2, "", 1, "");
addItem("1008", "Lasersysteme", "/pi8/index.php", 1, "", 1, "");
addItem("10012", "RGY_X2Projektoren", "/pi8/pi12/index.php", 2, "", 1, "");
addItem("10013", "RGB_X2Projektoren", "/pi8/pi13/index.php", 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;
		
	};
};