var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1008", "nach_20Legierung", "/verlobungsringe/index.html", 1, "", 1, "");
addItem("10016", "Verlobungsringe_20Gelbgold", "/verlobungsringe/verlobungsringe_gold/index2.html", 2, "", 1, "");
addItem("10017", "Verlobungsringe_20Weissgold", "/verlobungsringe/verlobungsringe_weissgold/index.html", 2, "", 1, "");
addItem("10029", "Verlobungsringe_20Titan", "/verlobungsringe/verlobunsring-titan/index.html", 2, "", 1, "");
addItem("10027", "Verlobungsringe_20Platin", "/verlobungsringe/verlobungsringe_platin/index.html", 2, "", 1, "");
addItem("10028", "Verlobungsringe_20Klassiker", "/trauringe-klassiker/index.html", 1, "", 1, "");
addItem("1007", "nach_20Preis", "/verlobungsringe_preis/index.html", 1, "", 1, "");
addItem("10010", "Verlobungsringe_20bis_20500_20Euro", "/verlobungsringe_preis/verlobungsringe_bis_500/index.html", 2, "", 1, "");
addItem("10011", "Verlobungsringe_20bis_201_X3000_20Euro", "/verlobungsringe_preis/verlobungsringe_bis-1000/index.html", 2, "", 1, "");
addItem("10012", "Verlobungsinge_20ab_201_X3000_20Euro", "/verlobungsringe_preis/verlobungsringe_ab_1000/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;
		
	};
};