var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1004", "Close_20up_20Zauberei_20(53)", "/zaubertricks/index.html", 1, "", 1, "");
addItem("1002", "Stand_20up_20Zauberei_20(37)", "/schnaeppchen-angebote/index.html", 1, "", 1, "");
addItem("1007", "Kartentricks_20(33)", "/kartentricks/index.html", 1, "", 1, "");
addItem("1005", "Zauberdvd_20_X7_20Zauberb_C3_BCcher_20(30)", "/zauberdvd/index.html", 1, "", 1, "");
addItem("1006", "Zauberschn_C3_A4ppchen_20(8)", "/zauberschnaeppchen/index.html", 1, "", 1, "");
addItem("1008", "Seident_C3_BCcher_20(5)", "/seidentuecher/index.html", 1, "", 1, "");
addItem("1009", "Mentalzauberei_20(7)", "/mentalzauberei/index.html", 1, "", 1, "");
addItem("10011", "Video_20Spezial_20(27)", "/video-spezial/index.html", 1, "", 1, "");
addItem("10012", "M_C3_BCnz_20Zauberei_20(5)", "/muenz-zauberei/index.html", 1, "", 1, "");
addItem("10014", "Top_20Tricks_20aus_20der_20ganzen_20Welt_20(8)", "/top-tricks-aus-amerika/index.html", 1, "", 1, "");
addItem("10015", "Sean_20Bogunia_20Special_20(3)", "/sean-bogunia-special/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;
		
	};
};