var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "3D_X2Modelle", "/modelle/index.html", 1, "3d16px.png", 1, "");
addItem("1007", "3ds_20_X7_20obj", "/modelle/3ds/index.html", 2, "3ds_logo_16.png", 1, "");
addItem("1002", "Bryce", "/modelle/bryce/index.html", 2, "bryce-logo16px.png", 1, "");
addItem("1009", "Carrara", "/modelle/carrara/index.html", 2, "carrara-logo_16.png", 1, "");
addItem("10011", "Poser_20_X4_20D_7CS", "/modelle/poser-ds/index.html", 2, "poser-logo16.png", 1, "");
addItem("10013", "Vue", "/modelle/vue/index.html", 2, "vue16.png", 1, "");
addItem("10014", "Cinema_204D", "/modelle/cinema-4d/index.html", 2, "c4d-logo16.png", 1, "");
addItem("10010", "3D_X2Pflanzen", "/3dplants/index.html", 1, "3dplants_16px.png", 1, "");
addItem("1005", "ActiveRendering", "/activerendering/index.html", 1, "ar-logo_16.png", 1, "");
addItem("1003", "Texturen", "/texturen/index.html", 1, "tex_ico_16.png", 1, "");
addItem("1008", "Sonstiges", "/sonstiges/index.html", 1, "sonstiges_16.png", 1, "");
addItem("10015", "Virtuelle_20Werft", "/virtuelle-werft/index.html", 1, "vw16px.png", 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;
		
	};
};