//var combodropimage='images/arrow.gif' //path to "drop down" image
var combodropimage='<img class="downimage" src="images/arrow.gif" />'
var combodropoffsetY=3 //offset of drop down menu vertically from default location (in px)
var combozindex=100

function dhtmlselect(selectid){
	
	// inject drop image
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect">'+combodropimage+" "+selectbox.title+'<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>')
	
	//close div's and hide menu initially
	document.write('</div></div>')
	selectbox.style.display="none"
	
	//set zindex and decrement
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	
	//offset menu dropbox
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	
	//show menu
	dhtmlselectbox.onmouseover=function() {
		this.getElementsByTagName("div")[0].style.display="block"
	}
	//hide menu
	dhtmlselectbox.onmouseout=function() {
		this.getElementsByTagName("div")[0].style.display="none"
	}
}
