var combodropimage='' //path to "drop down" image
var combodropoffsetY=2 //offset of drop down menu vertically from default location (in px)
var combozindex=100;
var combocount = 0;
if (combodropimage!="")
combodropimage='<img class="downimage" src="'+combodropimage+'" title="Select an option" / width=1 height=1>'
function dhtmlselect(selectid, selectwidth, optionwidth){
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect"><table class="menu_table"><tr><td><a href="'+selectid+'"><div>'+selectbox.title+'<br/><span class="countspan">0'+(++combocount)+'</span></div></a><div class="dropdown"><table class="submenu_table">')

	for (var i=0; i<selectbox.options.length; i++)
		document.write('<tr><td><a href="'+selectbox.options[i].value+'"><div>'+selectbox.options[i].text+'</div></a></td></tr>')
	document.write('</table></div></td></tr></table></div>')
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--;

	//for(i in dhtmlselectbox) document.write(i+'<br>');
	
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth;
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[1].style.width=optionwidth;
	dhtmlselectbox.getElementsByTagName("div")[1].style.top=55;//dhtmlselectbox.offsetHeight-combodropoffsetY+"px";

	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[1].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[1].style.display="none"
	}
}
