var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10024", "Aufkleber", "/aufkleber/index.html", 1, "", 1, "");
addItem("10022", "Aufn_C3_A4her", "/aufnaeher/index.html", 1, "", 1, "");
addItem("10040", "B_C3_BCcher", "/buecher/index.html", 1, "", 1, "");
addItem("10032", "Damenshirts", "/fittet-shirts/index.html", 1, "", 1, "");
addItem("10054", "Achselshirt", "/fittet-shirts/racebacks/index.html", 2, "", 1, "");
addItem("10059", "Ladyshirts", "/fittet-shirts/figurbetont/index.html", 2, "", 1, "");
addItem("10016", "Tr_C3_A4gertop", "/fittet-shirts/traegertops/index.html", 2, "", 1, "");
addItem("10046", "Dreamcatcher_20_X7_20Mandela", "/dreamcatcher/index.html", 1, "", 1, "");
addItem("10041", "Geldb_C3_B6rsen", "/geldboersen/index.html", 1, "", 1, "");
addItem("10043", "G_C3_BCrtelschnallen", "/guertelschnallen/index.html", 1, "", 1, "");
addItem("10033", "Karten_20und_20Co", "/karten-und-co/index.html", 1, "", 1, "");
addItem("1002", "Kindershirts", "/fuer-kids/index.html", 1, "", 1, "");
addItem("10058", "T_X2Shirts", "/fuer-kids/t-shirts/index.html", 2, "", 1, "");
addItem("10053", "Kinder_20Sweater", "/fuer-kids/kinder-sweater/index.html", 2, "", 1, "");
addItem("10049", "kleine_20Geschenke", "/diverses/index.html", 1, "", 1, "");
addItem("1004", "NEU_20im_20SHOP", "/neu-eingetroffen/index.html", 1, "", 1, "");
addItem("10050", "Pl_C3_BCschw_C3_B6lfe", "/plueschtiere/index.html", 1, "", 1, "");
addItem("10039", "Puzzels", "/puzzels/index.html", 1, "", 1, "");
addItem("1008", "SCHN_C3_84PPCHEN", "/schnaeppchen/index.html", 1, "", 1, "");
addItem("10031", "Silberschmuck", "/schmuck/index.html", 1, "", 1, "");
addItem("1006", "Anh_C3_A4nger", "/schmuck/anhaenger/index.html", 2, "", 1, "");
addItem("10021", "Armb_C3_A4nder", "/schmuck/armbaender/index.html", 2, "", 1, "");
addItem("10057", "Diverses", "/schmuck/diverses2/index.html", 2, "", 1, "");
addItem("10011", "Ketten", "/schmuck/ketten/index.html", 2, "", 1, "");
addItem("10015", "Ohrringe", "/schmuck/ohrringe/index.html", 2, "", 1, "");
addItem("10019", "Ringe", "/schmuck/ringe/index.html", 2, "", 1, "");
addItem("10020", "Sweater", "/sweater/index.html", 1, "", 1, "");
addItem("10030", "Taschen", "/taschen/index.html", 1, "", 1, "");
addItem("10012", "T_X2Shirts", "/shirts/index.html", 1, "", 1, "");
addItem("10013", "T_X2Shirts_20The_20Mountain", "/2-woelfe/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;
		
	};
};