var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1009", "Hufschuhe", "/hufschuhe/index.htm", 1, "", 1, "");
addItem("10032", "Easyboot_20Glove", "/hufschuhe/easyboot-glove/index.htm", 2, "", 1, "");
addItem("10033", "Easyboot_20Edge", "/hufschuhe/easyboot-edge/index.htm", 2, "", 1, "");
addItem("10031", "Renegade_20Hufschuhe", "/hufschuhe/renegade-hufschuhe/index.htm", 2, "", 1, "");
addItem("10034", "Easyboot_20RX", "/hufschuhe/easyboot-rx/index.htm", 2, "", 1, "");
addItem("1004", "BOA_20Horse_20Boots", "/hufschuhe/boa-horse-boots/index.htm", 2, "", 1, "");
addItem("10016", "Easyboots_202007", "/hufschuhe/easyboots-standard/index.htm", 2, "", 1, "");
addItem("10036", "Easyboot_20PRE2005", "/hufschuhe/easyboot-pre2005/index.htm", 2, "", 1, "");
addItem("10018", "Easyboot_20Epic", "/hufschuhe/easyboot-epic/index.htm", 2, "", 1, "");
addItem("10021", "Easyboot_20Bare", "/hufschuhe/easyboot-bare/index.htm", 2, "", 1, "");
addItem("10028", "Old_20Mac_X9s", "/hufschuhe/old-macs/index.htm", 2, "", 1, "");
addItem("10027", "EasySoaker", "/hufschuhe/easycare-krankenschuh/index.htm", 2, "", 1, "");
addItem("10024", "Bosana_20Boots", "/hufschuhe/bosana-boots/index.htm", 2, "", 1, "");
addItem("10022", "Marquis_20Hufschuhe", "/hufschuhe/marquis-hufschuhe/index.htm", 2, "", 1, "");
addItem("10015", "Swiss_20Horse_20Boots", "/hufschuhe/swiss-horse-boots/index.htm", 2, "", 1, "");
addItem("1008", "Dallmer_20Clogs", "/hufschuhe/dallmer-clogs/index.htm", 2, "", 1, "");
addItem("1006", "Krankenschuh", "/hufschuhe/krankenschuh/index.htm", 2, "", 1, "");
addItem("10010", "Barrier_20Boots", "/hufschuhe/barrier-boots/index.htm", 2, "", 1, "");
addItem("10011", "Kunststoffbeschlag", "/kunststoffbeschlag/index.htm", 1, "", 1, "");
addItem("1001", "Easywalker", "/kunststoffbeschlag/easywalker/index.htm", 2, "", 1, "");
addItem("1002", "Marathons", "/kunststoffbeschlag/marathons/index.htm", 2, "", 1, "");
addItem("1003", "Trotters", "/kunststoffbeschlag/trotters/index.htm", 2, "", 1, "");
addItem("10013", "Werkzeug", "/werkzeug/index.htm", 1, "", 1, "");
addItem("10014", "Pflegeartikel", "/pflegeartikel/index.htm", 1, "", 1, "");
addItem("10019", "Ern_C3_A4hrung", "/ernaehrung/index.htm", 1, "", 1, "");
addItem("10035", "NHC", "/nhc/index.htm", 1, "", 1, "");
addItem("10038", "Reitartikel", "/reitartikel/index.htm", 1, "", 1, "");
addItem("10039", "Steigb_C3_BCgel", "/reitartikel/steigbuegel/index.htm", 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;
		
	};
};