var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Adidas_20Fussballschuhe", "/pi1/index.html", 1, "", 1, "");
addItem("10013", "Herren", "/pi1/pi13/index.html", 2, "", 1, "");
addItem("10014", "Damen", "/pi1/pi14/index.html", 2, "", 1, "");
addItem("10012", "Kinder", "/pi1/pi12/index.html", 2, "", 1, "");
addItem("10016", "Nike_20Fussball", "/pi16/index.html", 1, "", 1, "");
addItem("1005", "miadidas", "/pi5/index.html", 1, "", 1, "");
addItem("1009", "Fussballzubeh_C3_B6r", "/pi9/index.html", 1, "", 1, "");
addItem("1006", "Fussb_C3_A4lle", "/pi6/index.html", 1, "", 1, "");
addItem("10015", "Fanshop", "/pi15/index.html", 1, "", 1, "");
addItem("1008", "Torwart", "/pi8/index.html", 1, "", 1, "");
addItem("1002", "Adidas_X2Originals", "/pi2/index.html", 1, "", 1, "");
addItem("10017", "Herren", "/pi2/pi17/index.html", 2, "", 1, "");
addItem("10018", "Damen", "/pi2/pi18/index.html", 2, "", 1, "");
addItem("10019", "Kinder", "/pi2/pi19/index.html", 2, "", 1, "");
addItem("10020", "Unisex", "/pi2/pi20/index.html", 2, "", 1, "");
addItem("1004", "MBT_X2Schuhe", "/pi4/index.html", 1, "", 1, "");
addItem("1007", "Ausverkaufartikel", "/pi7/index.html", 1, "", 1, "");
addItem("10010", "Fussball", "/pi7/pi10/index.html", 2, "", 1, "");
addItem("10011", "MBT", "/pi7/pi11/index.html", 2, "", 1, "");
addItem("10021", "Adidas_20Div_X3", "/pi21/index.html", 1, "adidas-logoweiss-medium.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;
		
	};
};