var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10015", "Funktioner", "/funktioner/funktioner.html", 1, "", 1, "");
addItem("10017", "Download_20Pr_C3_B8veversion", "/download/download.html", 1, "", 1, "");
addItem("10011", "Sk_C3_A6rmbilleder", "/screenshots/screenshots.html", 1, "", 1, "");
addItem("100108", "SummaSummarum", "/summasummarum/index.html", 1, "", 1, "");
addItem("100141", "Support", "/support2/index.html", 1, "", 1, "");
addItem("100142", "Download", "/download2/index.html", 1, "", 1, "");
addItem("10026", "MS_20Office_20Addins", "/ms-office-addins/officeaddins.html", 1, "", 1, "");
addItem("100134", "Bestil_20licenser!", "/workstation-licenser/index.html", 1, "", 1, "");
addItem("100136", "til_20workstation_20pc", "/workstation-licenser/til-workstation-pc/index.html", 2, "", 1, "");
addItem("100137", "til_20Terminal_X4Citrix_20Server", "/workstation-licenser/til-terminal-servercitrix-server/index.html", 2, "", 1, "");
addItem("10054", "Download", "/workstation-licenser/til-terminal-servercitrix-server/download/index.html", 3, "", 1, "");
addItem("100138", "Dynamics_20C5", "/dynamics-c5/index.html", 1, "", 1, "");
addItem("10012", "PDF_20kommandoer", "/pdf-kommandoer/pdfkommandoer.html", 1, "", 1, "");
addItem("10021", "History", "/history/history.html", 1, "", 1, "");
addItem("10043", "Opgradering!", "/opgradering/index.html", 1, "", 1, "");
addItem("10045", "Workstation_20licenser", "/opgradering/workstation/index.html", 2, "", 1, "");
addItem("10046", "TSE_20Conn_X3_20licenser", "/opgradering/connection-licenser/index.html", 2, "", 1, "");
addItem("10047", "TSE_20Serverlicenser", "/opgradering/tse-serverlicenser/index.html", 2, "", 1, "");
addItem("10014", "Kunder", "/kunder/kunder.html", 1, "", 1, "");
addItem("10025", "FAQ", "/faq/index.html", 1, "", 1, "");
addItem("100139", "Terminal_X4Citrix_20Server", "/terminalcitrix-server/index.html", 1, "", 1, "");
addItem("100140", "Download", "/terminalcitrix-server/download/index.html", 2, "", 1, "");
addItem("100143", "PDA_X4A_20format_20til_20arkivering", "/pdaa-format/index.html", 1, "", 1, "");
addItem("100144", "Drag2PDF_20_X2_20modul", "/drag2pdf/index.html", 1, "", 1, "");
addItem("100145", "iPaper_20CMS", "/ipaper-cms/index.html", 1, "", 1, "");
addItem("100149", "Hvad_20er_20iPaper?", "/ipaper-cms/hvad-er-ipaper/index.html", 2, "", 1, "");
addItem("100146", "Standardfunktioner", "/ipaper-cms/standard-funktioner/index.html", 2, "", 1, "");
addItem("100148", "iPaper_20licenser", "/ipaper-cms/ipaper-licenser/index.html", 2, "", 1, "");
addItem("100151", "Quick_20steps", "/ipaper-cms/quick-steps/index.html", 2, "", 1, "");
addItem("100147", "Till_C3_A6gsmoduler", "/ipaper-cms/tillgsmoduler/index.html", 2, "", 1, "");
addItem("100150", "Referencer", "/ipaper-cms/referencer/index.html", 2, "", 1, "");
addItem("100152", "Kontakt_20os_X3_X3_X3", "/ipaper-cms/kontakt-os/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;
		
	};
};