var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10024", "Secrets_20du_20Potager", "/secrets-du-potager/index.html", 1, "pftisch150.jpg", 1, "");
addItem("10025", "Saatp_C3_A4ckchen", "/secrets-du-potager/saatpaeckchen/index.html", 2, "saatp150.jpg", 1, "");
addItem("10026", "Anzucht_20Sets", "/secrets-du-potager/anzucht-sets/index.html", 2, "anzucht150.jpg", 1, "");
addItem("10027", "Anzucht_20Pflanzk_C3_A4sten", "/secrets-du-potager/anzucht-pflanzkaesten/index.html", 2, "anzuchtkasten150.jpg", 1, "");
addItem("10028", "F_C3_BCr_20die_20K_C3_BCche", "/secrets-du-potager/fuer-die-kueche/index.html", 2, "kueche150.jpg", 1, "");
addItem("10029", "F_C3_BCr_20den_20Garten", "/secrets-du-potager/fuer-den-garten/index.html", 2, "bild150-2.jpg", 1, "");
addItem("10019", "Gardentools", "/gardentools/index.html", 1, "gt23_400.jpg", 1, "");
addItem("10030", "Beetk_C3_A4sten", "/gardentools/beetkaesten/index.html", 2, "gt33_150.jpg", 1, "");
addItem("10031", "Werkzeug", "/gardentools/werkzeug/index.html", 2, "gt23_150.jpg", 1, "");
addItem("10032", "Kleidung_20und_20Taschen", "/gardentools/kleidung/index.html", 2, "gtkleidung150.jpg", 1, "");
addItem("10033", "Gieskannen", "/gardentools/gieskannen/index.html", 2, "tg171_150.jpg", 1, "");
addItem("1008", "Aged_20Metal_20Collection", "/aged-metal-collection/index.html", 1, "am04_150.jpg", 1, "");
addItem("10012", "Farm_20Folklore", "/farm-folklore/index.html", 1, "cf05g_150.jpg", 1, "");
addItem("10014", "Best_20for_20Birds", "/best-for-birds2/index.html", 1, "nk29_gelb120.jpg", 1, "");
addItem("10023", "Miscellaneous", "/miscellaneous/index.html", 1, "miscellan.jpg", 1, "");
addItem("10021", "Kids_20in_20the_20Garden", "/kids-in-the-garden/index.html", 1, "tg62.jpg", 1, "");
addItem("10034", "Gartenm_C3_B6bel", "/gartenmoebel/index.html", 1, "25211-011_150.jpg", 1, "");
addItem("10035", "B_C3_A4nke", "/gartenmoebel/baenke/index.html", 2, "27151-219_150.jpg", 1, "");
addItem("10036", "Tische", "/gartenmoebel/tische/index.html", 2, "25906-011_150.jpg", 1, "");
addItem("10040", "St_C3_BChle", "/gartenmoebel/stuehle/index.html", 2, "27154-219_150.jpg", 1, "");
addItem("10041", "Kinderwelt", "/kinderwelt/index.html", 1, "sarah05.jpg", 1, "");
addItem("10042", "Spielh_C3_A4user", "/kinderwelt/spelhaeuser/index.html", 2, "sarah05.jpg", 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;
		
	};
};