var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10046", "Bewertungskriterien", "/pi46/index.html", 1, "", 1, "");
addItem("10025", "Gewichtsverlauf", "/pi25/index.html", 1, "", 1, "_blank");
addItem("10039", "Abgeschlossener_20Kurs", "/media/docs/2007-28-04-kurs-gewichtsverlauf-10-woche.pdf", 2, "", 1, "_blank");
addItem("10040", "Laufender_20Kurs", "/media/docs/2007-23-06-kurs-gewichtsverlauf-6-woche.pdf", 2, "", 1, "_blank");
addItem("10026", "Kommentare", "/pi26/index.html", 1, "", 1, "");
addItem("10029", "Fragen", "/pi29/index.html", 1, "", 1, "");
addItem("10031", "Wissenschaftl_X3_20Leitung", "/pi31/index.html", 1, "", 1, "");
addItem("10041", "Wissenschaftl_X3_20Grundlagen", "/pi41/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;
		
	};
};