var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Terrakotta_20(35)", "/terrakotta/sahara-collection.html", 1, "", 1, "");
addItem("1002", "Tadelakt_20(12)", "/kunst/tadelakt2.html", 1, "", 1, "");
addItem("1005", "Berbergef_C3_A4_C3_9Fe_20(13)", "/berbergefaesse/berber.html", 1, "", 1, "");
addItem("10021", "Tische_20aus_20edlem_20Tadelakt_20(1)", "/tische-aus-edlen-tadelakt/index.html", 1, "", 1, "");
addItem("10019", "Mosaiktische_20mit_20mediterranen_20Flair_20(1)", "/mosaiktische/index.html", 1, "", 1, "");
addItem("10014", "Luxuri_C3_B6se_20Tische_20aus_20Granitmosaiken", "/luxurioese-tische-aus-granitmosaik/index.html", 1, "", 1, "");
addItem("1004", "Windlichter_20aus_20Terrakotta_20(7)", "/windlichter/terrakotta.html", 1, "", 1, "");
addItem("1006", "Mosaikbrunnen_20(4)", "/mosaikarbeiten/mosaik.html", 1, "", 1, "");
addItem("1007", "Antikes_20f_C3_BCr_20Liebhaber_20_X7_20Sammler_20(9)", "/holz-anitkes-und-kunst/antike_tueren.html", 1, "", 1, "");
addItem("10010", "Antike_20T_C3_BCren_20(5)", "/trendartikel-fuer-endverbraucher/antike-tueren/index.html", 2, "", 1, "");
addItem("10011", "Tuareg_20Gegenst_C3_A4nde_20(3)", "/holz-anitkes-und-kunst/tuareg-gegenstaende/index.html", 2, "", 1, "");
addItem("10012", "Verschiedenes_20(1)", "/holz-anitkes-und-kunst/verschiedenes/index.html", 2, "", 1, "");
addItem("10026", "Lava_20Stone_20Buddhas_20(1)", "/lava-stone-buddhas/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;
		
	};
};