var combodropimage='/pic/downbox.gif' //path to "drop down" image
var combodropoffsetY=2 //offset of drop down menu vertically from default location (in px)
var combozindex=100

if (combodropimage!="")
	combodropimage='<img class="downimage" src="'+combodropimage+'" title="Válassz" />'

function dhtmlselect(selectid, formname, selectwidth, optionwidth){
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect"><div id="dhtml_1_'+selectid+'"><span class="dhtmlselect_1" id="'+selectid +'_i">' + selectbox.title + '</span> '+combodropimage+'</div><div class="dropdown" id="dhtml_2_'+selectid+'">')
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="javascript:;" onclick="document.getElementById(\'' + selectid + '_i\').innerHTML=\''+ selectbox.options[i].text +'\'; document.'+formname+'.' + selectid + '.value=\''+ selectbox.options[i].value +'\'">' + selectbox.options[i].text + '</a>')
	document.write('</div></div>')
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	var selbox_1=document.getElementById("dhtml_1_"+selectid)
	var selbox_2=document.getElementById("dhtml_2_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[0].style.width=optionwidth
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	if (combodropimage!="")
		dhtmlselectbox.getElementsByTagName("img")[0].style.left=dhtmlselectbox.offsetWidth+3+"px"
	selbox_1.onclick=function(){
		selbox_2.style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		setTimeout("", 1000);
		selbox_2.style.display="none"
 	}
	selbox_2.onmouseover=function(){
		setTimeout("", 1000);
		selbox_2.style.display="block"
 	}

	selbox_2.onclick=function(){
		selbox_2.style.display="none"
	}
}

function aa(selectid) {
document.getElementById("dhtml_2_"+selectid)
}