var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "T_X2Shirts", "/t-shirts/index.html", 1, "", 1, "");
addItem("10013", "Damen", "/t-shirts/damen/index.html", 2, "", 1, "");
addItem("10014", "Herren", "/t-shirts/herren/index.html", 2, "", 1, "");
addItem("10015", "Kinder_20_X7_20Baby", "/t-shirts/kinder-baby/index.html", 2, "", 1, "");
addItem("1003", "Polo_X2Shirts", "/polo-shirts/index.html", 1, "", 1, "");
addItem("10016", "Damen", "/polo-shirts/damen/index.html", 2, "", 1, "");
addItem("10017", "Herren", "/polo-shirts/herren/index.html", 2, "", 1, "");
addItem("10024", "Blusen_20_X7_20Hemden", "/blusen-hemden/index.html", 1, "", 1, "");
addItem("10025", "Damen", "/blusen-hemden/damen/index.html", 2, "", 1, "");
addItem("10026", "Herren", "/blusen-hemden/herren/index.html", 2, "", 1, "");
addItem("1004", "Jacken_20_X7_20Sweatshirts", "/jacken-sweatshirts/index.html", 1, "", 1, "");
addItem("1009", "Karneval", "/karneval/index.html", 1, "", 1, "");
addItem("1005", "Accessoires", "/schmuck-pins/index.html", 1, "", 1, "");
addItem("10021", "Schmuck", "/schmuck-pins/schmuck/index.html", 2, "", 1, "");
addItem("10022", "Pins_20_X7_20Anstecker", "/schmuck-pins/pins/index.html", 2, "", 1, "");
addItem("1006", "Aufkleber_20_X7_20Wandtatoo", "/aufkleber-wandtatoo/index.html", 1, "", 1, "");
addItem("1007", "Taschen_20_X7_20B_C3_BCggel", "/taschen-bueggel/index.html", 1, "", 1, "");
addItem("1008", "Caps_20_X7_20M_C3_BCtzen", "/caps-muetzen/index.html", 1, "", 1, "");
addItem("10027", "Deutschland_20WM_20Shirt", "/deutschland/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;
		
	};
};