var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("100120", "Zertifizierungen", "/zertifizierungen/index.html", 1, "", 1, "");
addItem("100112", "Geb_C3_A4ude_X2Check", "/gebaeude/index.html", 1, "", 1, "");
addItem("100113", "Heizungscheck", "/gebaeude/heizungscheck/index.html", 2, "", 1, "");
addItem("100114", "Gas_X2ganz_X2sicher_X2Check", "/gebaeude/gas-ganz-sicher-check/index.html", 2, "", 1, "");
addItem("100115", "Trinkwassercheck", "/gebaeude/trinkwassercheck/index.html", 2, "", 1, "");
addItem("100116", "Entw_C3_A4sserungs_X2Check", "/gebaeude/entwaesserungs-check/index.html", 2, "", 1, "");
addItem("10026", "Wartung", "/wartung/index.html", 1, "", 1, "");
addItem("1001", "Unternehmen", "/unternehmen/index.html", 1, "", 1, "");
addItem("100117", "Einsatzgebiet", "/einsatzgebiet/index.html", 1, "", 1, "");
addItem("100121", "Heizungskonfigurator", "/heizungskonfigurator/index2.html", 1, "", 1, "");
addItem("1001251", "01_X3_20_C3_96lheizung", "/http://www.heiztechnikshop.com/01-oel/index.html", 2, "", 1, "");
addItem("1001252", "02_X3_20Gasheizung", "/http://www.heiztechnikshop.com/02-gas/index.html", 2, "", 1, "");
addItem("1001253", "03_X3_20W_C3_A4rmepumpe", "/http://www.heiztechnikshop.com/03-waermepumpe/index.html", 2, "", 1, "");
addItem("1001254", "04_X3_20Holzheizung", "/http://www.heiztechnikshop.com/04-holz/index.html", 2, "", 1, "");
addItem("1001255", "05_X3_20Solar_20_X1_20Warmwasser", "/http://www.heiztechnikshop.com/05-solar-warmwasser/index.html", 2, "", 1, "");
addItem("1001256", "10_X3_20Heizk_C3_B6rper", "/http://www.heiztechnikshop.com/10-heizkoerper/index.html", 2, "", 1, "");
addItem("1001250", "STLB_20679_X2681", "/stlb/index.html", 1, "", 1, "");
addItem("100867", "STLB_20679", "/stlb/679/index.html", 2, "", 1, "_self");
addItem("1001144", "STLB_20680", "/stlb/681/index.html", 2, "", 1, "");
addItem("1001198", "STLB_20681", "/stlb/681/index2.html", 2, "", 1, "");
addItem("10010", "Referenzen", "/referenzen/index.html", 1, "", 1, "");
addItem("1004", "Job", "/job/index.html", 1, "", 1, "");
addItem("100823", "Freistellung", "/freistellung/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;
		
	};
};