var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Piercingschmuck", "/piercingschmuck/index.html", 1, "", 1, "");
addItem("1002", "Barbell", "/piercingschmuck/barbell/index.html", 2, "", 1, "");
addItem("1003", "Labret", "/piercingschmuck/labret/index.html", 2, "", 1, "");
addItem("1004", "Fleshtunnel", "/piercingschmuck/fleshtunnel/index.html", 2, "", 1, "");
addItem("1005", "Tribal", "/piercingschmuck/tribal/index.html", 2, "", 1, "");
addItem("1006", "Ball_20Closure_20Ring", "/piercingschmuck/ball-closure-ring/index.html", 2, "", 1, "");
addItem("1007", "Dehnungssichel", "/piercingschmuck/dehnungssichel/index.html", 2, "", 1, "");
addItem("1008", "Curved_20Barbell", "/piercingschmuck/curved-barbell/index.html", 2, "", 1, "");
addItem("1009", "Circular_20Barbell", "/piercingschmuck/circular-barbell/index.html", 2, "", 1, "");
addItem("10019", "Spiral_20Barbell", "/piercingschmuck/spiral-barbell/index.html", 2, "", 1, "");
addItem("10018", "Segmentring", "/piercingschmuck/segmentring/index.html", 2, "", 1, "");
addItem("10010", "Intimschmuck", "/piercingschmuck/intimschmuck/index.html", 2, "", 1, "");
addItem("10020", "Nasenstecker", "/piercingschmuck/nasenstecker/index.html", 2, "", 1, "");
addItem("10011", "Piercing_20Teile_20und_20Zubeh_C3_B6r", "/piercingschmuck/piercing-teile-und-zubehoer/index.html", 2, "", 1, "");
addItem("10012", "Ketten", "/ketten/index.html", 1, "", 1, "");
addItem("10013", "Ketten_20mit_20Haizahn", "/ketten/ketten-mit-haizahn/index.html", 2, "", 1, "");
addItem("10014", "Rasta_20Ketten", "/ketten/rasta-ketten/index.html", 2, "", 1, "");
addItem("10015", "H_C3_A4matit_20Ketten", "/ketten/haematit-ketten/index.html", 2, "", 1, "");
addItem("10016", "Anh_C3_A4nger", "/anhaenger/index.html", 1, "", 1, "");
addItem("10017", "Edelstein_20Anh_C3_A4nger", "/anhaenger/edelstein-anhaenger/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;
		
	};
};