var combodropimage='images/downbox.gif' //path to "drop down" image
var combodropoffsetY=15 //offset of drop down menu vertically from default location (in px)
var combodropup=true
var combozindex=5

if (combodropimage!="")
	combodropimage='<img class="downimage" src="'+combodropimage+'" title="Select an option" />'

function dhtmlselect(selectid, selectwidth, optionwidth, combodropoffsetX){
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect">'+selectbox.title+" "+combodropimage+'<div class="dropdown">')
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="'+selectbox.options[i].value+'">'+selectbox.options[i].text+'</a>')
	document.write('</div></div>')
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+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
	var thisoffsetY = combodropoffsetY
	if (combodropup)
		thisoffsetY = i*combodropoffsetY
	var thisoffsetX = 0
	if (typeof combodropoffsetX!="undefined")
		thisoffsetX = combodropoffsetX
	
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-thisoffsetY+"px"
	dhtmlselectbox.getElementsByTagName("div")[0].style.left=thisoffsetX+"px"
	if (combodropimage!="") {
	}
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
		dhtmlselectbox.style.zIndex=6
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
		dhtmlselectbox.style.zIndex=combozindex
	}
}