var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10040", "Sportschuhe", "/pi40/index.html", 1, "", 1, "");
addItem("10048", "Textilien", "/pi48/index.html", 1, "", 1, "");
addItem("10051", "Speedminton", "/pi51/index.html", 1, "", 1, "");
addItem("10055", "Squash", "/pi148/index.html", 1, "", 1, "");
addItem("10022", "Squashschl_C3_A4ger", "/pi148/pi128/index.html", 2, "", 1, "");
addItem("10028", "Wilson", "/pi148/pi128/pi129/index.html", 3, "", 1, "");
addItem("10029", "Head", "/pi148/pi128/pi130/index.html", 3, "", 1, "");
addItem("10030", "Tecnifibre", "/pi148/pi128/pi131/index.html", 3, "", 1, "");
addItem("10035", "Prince", "/pi148/pi128/pi132/index.html", 3, "", 1, "");
addItem("10036", "Oliver", "/pi22/pi36/index.html", 3, "", 1, "");
addItem("10037", "Karakal", "/pi22/pi37/index.html", 3, "", 1, "");
addItem("10039", "Dunlop", "/pi22/pi39/index.html", 3, "", 1, "");
addItem("10053", "QM", "/pi22/pi53/index.html", 3, "", 1, "");
addItem("10042", "Squash_X2Griffb_C3_A4nde", "/pi148/pi42/index.html", 2, "", 1, "");
addItem("10044", "Squash_X2Saiten", "/pi148/pi44/index.html", 2, "", 1, "");
addItem("10047", "Tecnifibre", "/pi148/pi44/pi47/index.html", 3, "", 1, "");
addItem("10050", "Ashaway", "/pi148/pi44/pi50/index.html", 3, "", 1, "");
addItem("10054", "Wilson", "/pi148/pi44/pi147/index.html", 3, "", 1, "");
addItem("10045", "Squashb_C3_A4lle", "/pi148/pi45/index.html", 2, "", 1, "");
addItem("10056", "Tennis", "/pi149/index.html", 1, "", 1, "");
addItem("10057", "Tennisschl_C3_A4ger", "/pi149/pi150/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;
		
	};
};