var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "BookHolder_20Stand_20Model", "/pi8/pd2.html", 1, "", 1, "");
addItem("1002", "BookHolder_20Desk_20Model", "/pi9/pd1.html", 1, "", 1, "");
addItem("1003", "Reading_20Lights", "/pi10/index.html", 1, "", 1, "");
addItem("10012", "Prologue_20Reading_20Light", "/pi10/pi15/pd8.html", 2, "", 1, "");
addItem("10010", "Tetralogy_20Reading_20Light", "/pi10/pi13/pd6.html", 2, "", 1, "");
addItem("10011", "Trilogy_20Travel_20Light", "/pi10/pi14/pd7.html", 2, "", 1, "");
addItem("1009", "FlexArm_20Reading_20Light", "/pi10/pi12/pd5.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;
		
	};
};