var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10035", "BERG_20Gokart_20Classic", "/berg-gokart-classic/index.html", 1, "", 1, "");
addItem("10036", "BERG_20Gokart_20Ferrari", "/berg-gokart-ferrari/index.html", 1, "", 1, "");
addItem("10037", "BERG_20Gokart_20Offroad", "/berg-gokart-offroad/index.html", 1, "", 1, "");
addItem("10039", "BERG_20Gokart_20Traxx", "/berg-gokarttraxx/index.html", 1, "", 1, "");
addItem("10038", "BERG_20Gokart_20Race", "/berg-gokart-race/index.html", 1, "", 1, "");
addItem("10040", "BERG_20Gokart_20City_20Compact", "/berg-gokart-city-compact/index.html", 1, "", 1, "");
addItem("10042", "BERG_20Gokart_20Junior", "/berg-gokart-junior/index.html", 1, "", 1, "");
addItem("10041", "BERG_20Gokarts_20Specials", "/berg-gokarts-specials/index.html", 1, "", 1, "");
addItem("10044", "BERG_20MOOV", "/berg-moov/index.html", 1, "", 1, "");
addItem("10022", "BERG_20Gokart_20Zubeh_C3_B6r", "/gokart-zubehoer/index.html", 1, "", 1, "");
addItem("10023", "BERG_20Gokart_20Ersatzteile", "/gokart-ersatzteile/index.html", 1, "", 1, "");
addItem("10030", "BERG_20Gokarts_20gewerblich", "/gokart-gewerblich/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;
		
	};
};