var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Gartenzwerge_20bis_2025_20cm", "/gartenzwerge-bis-25-cm/index.html", 1, "", 1, "");
addItem("1002", "Gartenzwerge_20bis_2040_20cm", "/gartenzwerge-bis-40-cm/index.html", 1, "", 1, "");
addItem("1003", "Gartenzwerge_20ab_2040cm", "/gartenzwerge-ab-40cm/index.html", 1, "", 1, "");
addItem("1004", "Gruppen,_20Figuren,_20Sonstiges", "/gruppen-figuren-sonstiges/index.html", 1, "", 1, "");
addItem("1005", "Freches_20und_20Erotisches", "/freches-und-erotisches/index.html", 1, "", 1, "");
addItem("1007", "Ostern", "/ostern/index.html", 1, "", 1, "");
addItem("10017", "Jan_20Ptassek", "/jan-ptassek/index.html", 1, "", 1, "");
addItem("1006", "B_C3_BCcher", "/buecher/index.html", 1, "", 1, "");
addItem("1009", "Alles_20zusammen", "/alles-zusammen/index.html", 1, "", 1, "");
addItem("10010", "Pflegehinweise", "/http://www.zwergshop.ch/gartenzwerge/pflege.html", 1, "", 1, "");
addItem("10011", "G_C3_A4stebuch", "/http://www.zwergshop.ch/forum", 1, "", 1, "");
addItem("10012", "Fotogallerie", "/http://www.zwergshop.ch/zwergenbilder/index.php?lang=german", 1, "", 1, "");
addItem("10013", "Geschichte", "/http://www.zwergshop.ch/gartenzwerge/geschichte.html", 1, "", 1, "");
addItem("10014", "News", "/news/index.html", 1, "", 1, "");
addItem("10016", "Gartenzwerge_X2Ausstellung_20Einkaufszentrum_20Herti", "/news/gartenzwerge-ausstellung-herti/index2.html", 2, "", 1, "");
addItem("10018", "entf_C3_BChrte_20Zwerge", "/news/entfuehrte-zwerge/index.html", 2, "", 1, "");
addItem("10019", "unbezahlte_20Zwerge", "/news/unbezahlte-zwerge/index.html", 2, "", 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;
		
	};
};