var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10032", "Tischdecken_20einfarbig", "/tischdecken-einfarbig/index.html", 1, "", 1, "");
addItem("10033", "Tischdecken_20kariert", "/tischdecken-kariert/index.html", 1, "", 1, "");
addItem("10034", "Tischdecken_20rund", "/tischdecken-rund/index.html", 1, "", 1, "");
addItem("10035", "Tischdecken_20rechteckig", "/tischdecken-rechteckig/index.html", 1, "", 1, "");
addItem("10036", "Tischdecken_20oval", "/tischdecken-oval/index.html", 1, "", 1, "");
addItem("10037", "Tischdecken_20lang", "/tischdecken-lang/index.html", 1, "", 1, "");
addItem("10038", "Tischdecken_20schmal", "/tischdecken-schmal/index.html", 1, "", 1, "");
addItem("10039", "Tischdecken_20gro_C3_9F", "/tischdecken-gross/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;
		
	};
};