var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1009", "Produkte", "/produkte/index.html", 1, "", 1, "");
addItem("10010", "Top_X2Angebote", "/produkte/top-angebote/index.html", 2, "", 1, "");
addItem("1001", "B_C3_BCcher", "/produkte/hardcover/index.html", 2, "", 1, "");
addItem("1002", "H_C3_B6rb_C3_BCcher", "/produkte/hoerbuecher/index.html", 2, "", 1, "");
addItem("1005", "Brosch_C3_BCren", "/produkte/booklets/index.html", 2, "", 1, "");
addItem("1003", "English_20Books", "/produkte/english-books/index.html", 2, "", 1, "");
addItem("1007", "Klassiker_X2Vortr_C3_A4ge", "/produkte/classic-vortraege/index.html", 2, "", 1, "");
addItem("10013", "Kongress_X2Vortr_C3_A4ge", "/produkte/kongress-vortraege/index.html", 2, "", 1, "");
addItem("10015", "Grundlagen_X2Vortr_C3_A4ge", "/produkte/grundlagen-vortraege/index.html", 2, "", 1, "");
addItem("10012", "Fortgeschrittene_20B_C3_BCcher", "/produkte/fortgeschrittene-buecher/index.html", 2, "", 1, "");
addItem("1004", "DVD", "/produkte/dvd/index.html", 2, "", 1, "");
addItem("10016", "Gratis_X2Angebote", "/produkte/gratis-angebote/index.html", 2, "", 1, "");
addItem("10011", "ScienceFiction_X2B_C3_BCcher", "/produkte/sciencefiction-buecher/index.html", 2, "", 1, "");
addItem("10017", "Erfolgsberichte", "/produkte/erfolgsberichte/index.html", 2, "", 1, "");
addItem("10018", "YouTube_20Erfolgsberichte", "/produkte/youtube-erfolgsberichte/index.html", 2, "", 1, "");
addItem("10024", "Lebensverbesserungs_X2Kurse", "/produkte/lebensverbesserungs-kurs-packs/index.html", 2, "neu-2.gif", 1, "");
addItem("10020", "pulp_20fiction", "/pulp-fiction/index.html", 1, "", 1, "");
addItem("10021", "paperback", "/pulp-fiction/paperback/index.html", 2, "neu-2.gif", 1, "");
addItem("10022", "multicast_20audiobook", "/pulp-fiction/multicast-audiobook/index.html", 2, "neu-2.gif", 1, "");
addItem("10023", "pulp_20fiction_X2package", "/pulp-fiction/paperback-audiobook-package/index.html", 2, "neu-2.gif", 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;
		
	};
};