var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1003", "Kindermode_20Herbst_X2_20Wintermode_20bis_2050_20_25_20reduziert", "/herbst-wintermode-bis-30-reduziert/index.html", 1, "", 1, "");
addItem("1001", "Kindermode_20Winterjacken", "/herbst-wintermode-bis-30-reduziert/winterjacken/index.html", 2, "", 1, "");
addItem("1002", "Kindermode_20Girls_2067_X294", "/herbst-wintermode-bis-30-reduziert/girls-67-94/index.html", 2, "", 1, "");
addItem("1004", "Kindermode_20Girls_2086_X2126", "/herbst-wintermode-bis-30-reduziert/girls-86-126/index.html", 2, "", 1, "");
addItem("1007", "Kindermode_20Boys_2067_X294", "/herbst-wintermode-bis-30-reduziert/boys-67-94/index.html", 2, "", 1, "");
addItem("1009", "Kindermode_20Boys_2086_X2126", "/herbst-wintermode-bis-30-reduziert/boys-86-126/index.html", 2, "", 1, "");
addItem("10011", "Kindermode_20Fr_C3_BChjahr_X2_20Sommermode_20bis_20_2050_20_25_20reduziert", "/fruehjahr-sommermode-bis-40-reduziert/index.html", 1, "", 1, "");
addItem("1005", "Kindermode_20Girls_2067_X294", "/fruehjahr-sommermode-bis-40-reduziert/girls-67-94/index.html", 2, "", 1, "");
addItem("1006", "Kindermode_20Girls_2092_X2150", "/fruehjahr-sommermode-bis-40-reduziert/girls-92-150/index.html", 2, "", 1, "");
addItem("1008", "Kindermode_20Boys_2067_X294", "/fruehjahr-sommermode-bis-40-reduziert/boys-67-94/index.html", 2, "", 1, "");
addItem("10010", "Kindermode_20Boys_2092_X2150", "/fruehjahr-sommermode-bis-40-reduziert/boys-92-150/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;
		
	};
};