var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10094", "Custom_20Fitting_20(2)", "/hauer/index.html", 1, "", 1, "");
addItem("100129", "Callaway_20Shop_20(35)", "/callaway-zubehoer/index.html", 1, "", 1, "");
addItem("10096", "Driver_20(16)", "/driver/index.html", 1, "", 1, "");
addItem("100101", "Fairway_20H_C3_B6lzer_20(12)", "/fairway-hoelzer/index.html", 1, "", 1, "");
addItem("10097", "Hybrids_20(10)", "/hybrids/index.html", 1, "", 1, "");
addItem("10098", "Eisens_C3_A4tze_20(18)", "/eisensaetze/index.html", 1, "", 1, "");
addItem("10099", "Wedges_20(9)", "/wedges/index.html", 1, "", 1, "");
addItem("100100", "Putter_20(18)", "/putter/index.html", 1, "", 1, "");
addItem("100102", "B_C3_A4lle_20(18)", "/baelle/index.html", 1, "", 1, "");
addItem("100110", "Trollys_20_X4_20e_X2Trollys_20(9)", "/trollys-e-trollys/index.html", 1, "", 1, "");
addItem("100107", "Schuhe_20(14)", "/schuhe/index.html", 1, "", 1, "");
addItem("100127", "Herren_20(8)", "/schuhe/herren/index.html", 2, "", 1, "");
addItem("100128", "Damen_20(5)", "/schuhe/damen/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;
		
	};
};