var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1005", "Farm_20Animals_20and_20People", "/farm-animals/index.html", 1, "", 1, "");
addItem("10029", "Cow_20_X7_20Pig", "/farm-animals/cow-pig/index.html", 2, "", 1, "");
addItem("10030", "Sheep_20_X7_20Goat", "/farm-animals/sheep-goat/index.html", 2, "", 1, "");
addItem("10031", "Hen,_20Duck_20_X7_20Goose", "/farm-animals/birds/index.html", 2, "", 1, "");
addItem("1007", "Horse_20_X7_20Donkey", "/farm-animals/horse-donkey/index.html", 2, "", 1, "");
addItem("10028", "Horses_20and_20Horseman", "/farm-animals/horse-horseman/index.html", 2, "", 1, "");
addItem("1006", "Doc_20_X7_20Cat", "/farm-animals/doc-cat/index.html", 2, "", 1, "");
addItem("1004", "Family", "/farm-animals/family/index.html", 2, "", 1, "");
addItem("1008", "Woodland_20Animals", "/woodland-animals/index.html", 1, "", 1, "");
addItem("1009", "Small_20Animals", "/woodland-animals/small-animals/index.html", 2, "", 1, "");
addItem("10011", "Big_20Animals", "/woodland-animals/big-animals/index.html", 2, "", 1, "");
addItem("10010", "Birds", "/woodland-animals/birds/index.html", 2, "", 1, "");
addItem("10012", "Exotic_20Animals", "/exotic-animals/index.html", 1, "", 1, "");
addItem("10013", "Lion_20_X7_20Tiger", "/exotic-animals/lion-tiger/index.html", 2, "", 1, "");
addItem("10015", "Elephant,_20Camel_20_X7_20Hippo", "/exotic-animals/elephant-camel-hippo/index.html", 2, "", 1, "");
addItem("10017", "Bear", "/exotic-animals/bear/index.html", 2, "", 1, "");
addItem("10018", "Dolphin_20_X7_20Penguin", "/exotic-animals/dolphin-penguin/index.html", 2, "", 1, "");
addItem("10014", "Exotic_20Birds", "/exotic-animals/birds/index.html", 2, "", 1, "");
addItem("10016", "more_20Animals_X3_X3_X3", "/exotic-animals/more-animals/index.html", 2, "", 1, "");
addItem("10019", "Knights,_20Pirates,_20Fairy_X2Tale,_20Castle", "/fairytale-knights/index.html", 1, "", 1, "");
addItem("10020", "Fairy_X2Tale_20Figures", "/fairytale-knights/fairytale/index.html", 2, "", 1, "");
addItem("10022", "Chivalrous_20Figures", "/fairytale-knights/chivalrous/index.html", 2, "", 1, "");
addItem("10021", "Castle", "/fairytale-knights/castle/index.html", 2, "", 1, "");
addItem("10058", "Castle_20Accessories", "/fairytale-knights/castle-accessories/index.html", 2, "", 1, "");
addItem("10037", "Pirates", "/fairytale-knights/pirates/index.html", 2, "", 1, "");
addItem("10023", "Native_20People", "/native-people/index.html", 1, "", 1, "");
addItem("10032", "Inuit", "/native-people/eskimo/index.html", 2, "", 1, "");
addItem("10027", "Nativity_20Figures", "/nativity-figures/index.html", 1, "", 1, "");
addItem("10041", "Circus", "/circus/index.html", 1, "", 1, "");
addItem("10063", "Craftsmen_20_X7_20Trades", "/craftsmen-trades/index.html", 1, "", 1, "");
addItem("10064", "Flower_20Children", "/flower-children/index.html", 1, "", 1, "");
addItem("10057", "Buildings", "/buildings/index.html", 1, "", 1, "");
addItem("10053", "Vehicles", "/vehicles/index.html", 1, "", 1, "");
addItem("10070", "small", "/vehicles/small/index.html", 2, "", 1, "");
addItem("10071", "large", "/vehicles/large/index.html", 2, "", 1, "");
addItem("10054", "Ship", "/ship/index.html", 1, "", 1, "");
addItem("10026", "Ark_20Noah", "/ship/ark-noah/index.html", 2, "", 1, "");
addItem("10055", "Corsair_20Ship", "/ship/corsair-ship/index.html", 2, "", 1, "");
addItem("10042", "Accessories", "/accessories/index.html", 1, "", 1, "");
addItem("10040", "Buildings", "/accessories/buildings/index.html", 2, "", 1, "");
addItem("10025", "Trees", "/accessories/trees/index.html", 2, "", 1, "");
addItem("10044", "Countryside_20plates", "/accessories/countryside-plates/index.html", 2, "", 1, "");
addItem("10045", "Fence", "/accessories/fence/index.html", 2, "", 1, "");
addItem("10046", "Human_20figures", "/accessories/human-figures/index.html", 2, "", 1, "");
addItem("10059", "Hand_20Puppets", "/hand-puppets/index.html", 1, "", 1, "");
addItem("10061", "Novelties", "/novelties2/index.html", 1, "", 1, "");
addItem("10062", "Novelties_202010", "/novelties2/novelties-2010/index.html", 2, "", 1, "");
addItem("10065", "Animals", "/novelties2/novelties-2010/animals/index.html", 3, "", 1, "");
addItem("10066", "Vehicles", "/novelties2/novelties-2010/vehicles/index.html", 3, "", 1, "");
addItem("10067", "Flower_20Children", "/novelties2/novelties-2010/flower-children/index.html", 3, "", 1, "");
addItem("10068", "Working_20People", "/novelties2/novelties-2010/working-people/index.html", 3, "", 1, "");
addItem("10069", "Hand_20Puppets", "/novelties2/novelties-2010/hand-puppets/index.html", 3, "", 1, "");
addItem("10043", "Novelties_202009", "/novelties2/novelties-2009/index.html", 2, "", 1, "");
addItem("10047", "Circus", "/novelties2/novelties-2009/circus/index.html", 3, "", 1, "");
addItem("10048", "Plates", "/novelties2/novelties-2009/plates/index.html", 3, "", 1, "");
addItem("10049", "Fence", "/novelties2/novelties-2009/fence/index.html", 3, "", 1, "");
addItem("10050", "Animals", "/novelties2/novelties-2009/animals/index.html", 3, "", 1, "");
addItem("10051", "Accessories", "/novelties2/novelties-2009/accessories/index.html", 3, "", 1, "");
addItem("10052", "Fairy_X2Tale_20Figures", "/novelties2/novelties-2009/fairy-tale-figures/index.html", 3, "", 1, "");
addItem("10056", "St_X3_20Martin_20and_20_20the_20beggar", "/novelties2/novelties-2009/st-martin-and-the-beggar/index.html", 3, "", 1, "");
addItem("10060", "Handpuppets", "/novelties2/novelties-2009/handpuppets/index.html", 3, "", 1, "");
addItem("10033", "Novelties_202008", "/novelties2/novelties/index.html", 2, "", 1, "");
addItem("10034", "Cats", "/novelties2/novelties/cats/index.html", 3, "", 1, "");
addItem("10035", "Rabbits", "/novelties2/novelties/rabbits/index.html", 3, "", 1, "");
addItem("10036", "Riding_20Horses_20and_20Riders", "/novelties2/novelties/riding-horses-riders/index.html", 3, "", 1, "");
addItem("10038", "Cows", "/novelties2/novelties/cows/index.html", 3, "", 1, "");
addItem("10039", "Pirates", "/novelties2/novelties/pirates/index.html", 3, "", 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;
		
	};
};