var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10067", "KOSY_20CNC_X2Maschinen", "/cnc-maschinen2/index.html", 1, "", 1, "");
addItem("10049", "KOSY3_20A4_20f_X3_20Schulen", "/cnc-maschinen2/kosy3-a4/index.html", 2, "", 1, "");
addItem("10050", "KOSY3_20A3_20f_X3_20Schulen", "/cnc-maschinen2/kosy3-a3-fuer-schulen/index.html", 2, "", 1, "");
addItem("10068", "Fr_C3_A4smotoren_X4_X2spindeln", "/spindeln/index.html", 1, "", 1, "");
addItem("10072", "nccad8_20_X2_20Schulversion", "/ncschulversion/index.html", 1, "", 1, "");
addItem("10073", "Software_X2Upgrades", "/su/index.html", 1, "", 1, "");
addItem("10074", "Demosoftware", "/downl/index.html", 1, "", 1, "");
addItem("10069", "Werkzeuge", "/wz/index.html", 1, "", 1, "");
addItem("10055", "VHM_X2Fr_C3_A4ser", "/wz/vhm-fraeser/index.html", 2, "", 1, "");
addItem("10057", "Gravierstichel", "/wz/gravierstichel/index.html", 2, "", 1, "");
addItem("10079", "Werkzeugs_C3_A4tze", "/wz/werkzeugsaetze/index.html", 2, "", 1, "");
addItem("10077", "Spannmittel", "/wz/spannmittel/index.html", 2, "", 1, "");
addItem("10058", "Spannzangen", "/wz/spannmittel/spannzangen/index.html", 3, "", 1, "");
addItem("10081", "Werkst_C3_BCckbefestigung", "/wz/spannmittel/werkstueckbefestigung/index.html", 3, "", 1, "");
addItem("10071", "KOSY3_20Zubeh_C3_B6r", "/kzubehoer/index.html", 1, "", 1, "");
addItem("10070", "Sicherheitssauger", "/ssauger/index.html", 1, "", 1, "");
addItem("10082", "Nilfisk_20ALTO", "/ssauger/nilfisk-alto/index.html", 2, "", 1, "");
addItem("10083", "K_C3_A4rcher", "/ssauger/kaercher/index.html", 2, "", 1, "");
addItem("10084", "RIBO", "/ssauger/ribo/index.html", 2, "", 1, "");
addItem("10012", "Schulungen", "/schulungen/index.html", 1, "", 1, "");
addItem("10076", "Werkraumeinrichtung", "/werkraumeinrichtung/index.html", 1, "", 1, "");
addItem("10040", "Preise", "/preise/index.html", 1, "", 1, "");
addItem("10036", "Infos_20f_C3_BCr_20Schulen", "/infos-fuer-schulen/index.html", 1, "", 1, "");
addItem("10011", "Weiterempfehlung", "/service/index.html", 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;
		
	};
};