var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10012", "Home", "/index.html", 1, "", 1, "");
addItem("1006", "Aktionen", "/aktionen/index.html", 1, "", 1, "");
addItem("10011", "Gutscheine", "/gutscheine/index.html", 1, "", 1, "");
addItem("1001", "CUT_20Banner", "/banner/index.html", 1, "", 1, "");
addItem("1002", "CUT_20Roller", "/rollups/index.html", 1, "", 1, "");
addItem("1004", "CUT_20St_C3_A4nder", "/werbestaender/index.html", 1, "", 1, "");
addItem("1003", "Baustellenbanner", "/baustellenbanner/index.html", 1, "", 1, "");
addItem("10014", "Schilder", "/schilder/index.html", 1, "", 1, "");
addItem("10015", "Acrylglas_20_X2_20Schilder", "/schilder/glas/index.html", 2, "", 1, "");
addItem("10016", "Gravierte_20Schilder", "/schilder/gravierte-schilder/index.html", 2, "", 1, "");
addItem("1005", "Firmenstempel", "/firmenstempel/index.html", 1, "", 1, "");
addItem("1009", "Trodat_20Printy", "/firmenstempel/trodat-printy/index.html", 2, "", 1, "");
addItem("10010", "Trodat_20Professional", "/firmenstempel/trodat-professional/index.html", 2, "", 1, "");
addItem("1007", "Colop_20Printer", "/firmenstempel/colop-printer/index.html", 2, "", 1, "");
addItem("1008", "Colop_20Classic_20Line", "/firmenstempel/colop-classic-line/index.html", 2, "", 1, "");
addItem("10013", "Plakate", "/plakate/index.html", 1, "", 1, "");
addItem("10020", "Mimaki", "/mimaki2/index.html", 1, "", 1, "");
addItem("10021", "Tinte", "/mimaki2/tinte/index.html", 2, "", 1, "");
addItem("10022", "Ersatzteile_20(gebraucht)", "/mimaki2/ersatzteile-gebraucht/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;
		
	};
};