var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1008", "nach_20Legierung", "/trauringe_legierung/index.html", 1, "", 1, "");
addItem("10016", "Trauringe_20Gelbgold", "/trauringe_legierung/trauringe_gold/index2.html", 2, "", 1, "");
addItem("10017", "Trauringe_20Weissgold", "/trauringe_legierung/trauringe_weissgold/index.html", 2, "", 1, "");
addItem("10018", "Trauringe_20mehrfarbig", "/trauringe_legierung/trauringe_bicolor/index.html", 2, "", 1, "");
addItem("10027", "Trauringe_20Platin", "/trauringe_legierung/trauringe_platin/index.html", 2, "", 1, "");
addItem("10031", "Trauringe_20Titan", "/trauringe_legierung/trauringe-titan3/index.html", 2, "", 1, "");
addItem("10028", "Trauringe_20Klassiker", "/trauringe-klassiker/index.html", 1, "", 1, "");
addItem("1009", "mit_20und_20ohne_20_20Diamant", "/tauringe_diamant/index2.html", 1, "", 1, "");
addItem("10013", "Trauringe_20mit_20Diamant", "/tauringe_diamant/trauringe_mit_diamant/index3.html", 2, "", 1, "");
addItem("10015", "Trauringe_20ohne_20Diamant", "/tauringe_diamant/trauringe_ohne_diamtant/index.html", 2, "", 1, "");
addItem("1007", "nach_20Preis", "/trauringe_preis/index.html", 1, "", 1, "");
addItem("10010", "Trauringe_20bis_20500_20Euro", "/trauringe_preis/trauringe_bis_500_eur/index.html", 2, "", 1, "");
addItem("10011", "Trauringe_20bis_201_X3000_20Euro", "/trauringe_preis/trauringe_bis-1000_eur/index.html", 2, "", 1, "");
addItem("10012", "Trauringe_20ab_201_X3000_20Euro", "/trauringe_preis/trauringe_ab_1000_eur/index.html", 2, "", 1, "");
addItem("10021", "Specials", "/specials/index.html", 1, "", 1, "");
addItem("10022", "Die_20sch_C3_B6nsten_20Diamanten", "/specials/die-schoensten-diamanten/index.html", 2, "", 1, "");
addItem("10023", "Ausgefallenes", "/specials/ausgefallenes/index.html", 2, "", 1, "");
addItem("10024", "eigenes_20Design", "/specials/trauringe_eigenes_design/index.html", 2, "", 1, "");
addItem("10025", "Sonderangebote", "/specials/sonderangebote/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;
		
	};
};