var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10040", "Innent_C3_BCren", "/pi40/index.html", 1, "", 1, "");
addItem("1001", "Standardt_C3_BCren", "/pi40/pi1/index.html", 2, "", 1, "");
addItem("1008", "Furniert", "/pi40/pi1/pi8/index.html", 3, "", 1, "");
addItem("1009", "Laminat", "/pi40/pi1/pi9/index.html", 3, "", 1, "");
addItem("10011", "Foliert", "/pi40/pi1/pi11/index.html", 3, "", 1, "");
addItem("10012", "Massiv", "/pi40/pi1/pi12/index.html", 3, "", 1, "");
addItem("10014", "Schichtstoff", "/pi40/pi1/pi14/index.html", 3, "", 1, "");
addItem("10035", "Modern", "/pi40/pi35/index.html", 2, "", 1, "");
addItem("10041", "Elegant", "/pi40/pi41/index.html", 2, "", 1, "");
addItem("10042", "Massiv", "/pi40/pi42/index.html", 2, "", 1, "");
addItem("10055", "Dominat", "/pi40/pi55/index.html", 2, "", 1, "");
addItem("10043", "Ganzglast_C3_BCren", "/pi40/pi43/index.html", 2, "", 1, "");
addItem("10052", "Rundbogent_C3_BCren", "/pi40/pi52/index.html", 2, "", 1, "");
addItem("10053", "Faltt_C3_BCren", "/pi53/index.html", 1, "", 1, "");
addItem("10054", "Kunststoff_X2Faltt_C3_BCren", "/pi53/pi54/index.html", 2, "", 1, "");
addItem("10029", "Haust_C3_BCren", "/pi29/index.html", 1, "", 1, "");
addItem("10030", "Aluminium_20_X2_20Haust_C3_BCren", "/pi29/pi30/index.html", 2, "", 1, "");
addItem("10031", "AG_20Trend", "/pi29/pi30/pi31/index.html", 3, "", 1, "");
addItem("10032", "AT_20Trend", "/pi29/pi30/pi32/index.html", 3, "", 1, "");
addItem("10045", "Holz_20_X2_20Haust_C3_BCren", "/pi29/pi45/index.html", 2, "", 1, "");
addItem("10046", "Serie_20Ecco", "/pi29/pi45/pi46/index.html", 3, "", 1, "");
addItem("10047", "Serie_20Dominant", "/pi29/pi45/pi47/index.html", 3, "", 1, "");
addItem("10048", "Serie_20Rundbogen", "/pi29/pi45/pi48/index.html", 3, "", 1, "");
addItem("10056", "Rundbogen_X2Stahlzargen", "/pi56/index.html", 1, "", 1, "");
addItem("1002", "Zubeh_C3_B6r", "/pi2/index.html", 1, "", 1, "");
addItem("10027", "T_C3_BCrgriffe", "/http://www.tuergriff-shop.at", 2, "", 1, "");
addItem("10044", "Gl_C3_A4ser", "/pi2/pi44/index.html", 2, "", 1, "");
addItem("10049", "M_C3_B6beln", "/pi49/index.html", 1, "", 1, "");
addItem("10050", "Badezimmerm_C3_B6beln", "/pi49/pi50/index.html", 2, "", 1, "");
addItem("10057", "Parkettb_C3_B6den", "/pi57/index.html", 1, "", 1, "");
addItem("10058", "Haro", "/pi57/pi58/index.html", 2, "", 1, "");
addItem("10059", "Kaindl", "/pi57/pi59/index.html", 2, "", 1, "");
addItem("10060", "tilo", "/pi57/pi60/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;
		
	};
};