var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("100183", "Vorschule", "/schulbeginn/index.html", 1, "", 1, "");
addItem("100184", "1_X3_20Klasse", "/lernprogramm_1-2-klasse/index.html", 1, "", 1, "");
addItem("100185", "2_X3_20Klasse", "/lernprogramm_3-4-klasse/index2.html", 1, "", 1, "");
addItem("100186", "3_X3_20Klasse", "/lernprogramm_3-4-klasse/index.html", 1, "", 1, "");
addItem("100171", "4_X3_20Klasse", "/lernprogramm_3-4-klasse/index3.html", 1, "", 1, "");
addItem("100172", "5_X3_20Klasse", "/lernprogramm_5-6-klasse/index.html", 1, "", 1, "");
addItem("100192", "6_X3_20Klasse", "/lernprogramm_6-klasse/index.html", 1, "", 1, "");
addItem("100193", "ab_207_X3_20Klasse", "/lernprogramme_sekundarstufe/index.html", 1, "", 1, "");
addItem("100191", "Englisch", "/lernspiele_englisch/index.html", 1, "", 1, "");
addItem("100188", "Fit_20im_20Leben", "/allgemeinbildung/index.html", 1, "", 1, "");
addItem("100181", "Gratis", "/gratis_download/index.html", 1, "", 1, "");
addItem("100195", "Download", "/sofort-download/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;
		
	};
};