var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10010", "Rollladen_20Zubeh_C3_B6r", "/stahlbandaufhaengungen/index.html", 1, "", 1, "");
addItem("10012", "Gurtwickler", "/stahlbandaufhaengungen/gurtwickler/index.html", 2, "", 1, "");
addItem("10036", "Ersatzgurte", "/stahlbandaufhaengungen/ersatzgurte/index.html", 2, "", 1, "");
addItem("10074", "Gurtf_C3_BChrungen", "/stahlbandaufhaengungen/gurtfuehrungen/index.html", 2, "", 1, "");
addItem("10011", "Gurtscheiben", "/zubehoer-rolladen/gurtscheiben/index.html", 2, "", 1, "");
addItem("10016", "Walzenkapseln_20_X4_20H_C3_BClsen", "/stahlbandaufhaengungen/huelsen/index.html", 2, "", 1, "");
addItem("1009", "Stahlbandaufh_C3_A4ngungen", "/stahlbandaufhaengungen/index2.html", 2, "", 1, "");
addItem("10013", "Anschlagpuffer", "/stahlbandaufhaengungen/anschlagstopfen-stopper/index.html", 2, "", 1, "");
addItem("10022", "Wellenlager_20_X4_20Kugellager", "/zubehoer-rolladen/wellenlager/index.html", 2, "", 1, "");
addItem("10038", "Klemm_X2_20Hochschiebesicherungen", "/zubehoer-rolladen/sicherungen/index.html", 2, "", 1, "");
addItem("10048", "Sonstiges_20Zubeh_C3_B6r", "/zubehoer-rolladen/sonstiges/index.html", 2, "", 1, "");
addItem("10049", "Abdeckkappen", "/zubehoer-rolladen/sonstiges/abdeckkappen/index.html", 3, "", 1, "");
addItem("10050", "Abdruckrollen", "/zubehoer-rolladen/sonstiges/abdruckrollen/index.html", 3, "", 1, "");
addItem("10075", "Gurtwickler_20Mauerkasten", "/stahlbandaufhaengungen/gurtwickler-kasten/index.html", 2, "", 1, "");
addItem("10037", "Sonderverkauf", "/http://", 1, "", 1, "");
addItem("10053", "Restposten", "/sonderposten/restposten/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;
		
	};
};