var combozindex = 100;

var interval = null;

function closeMenuTeste(o){
	$("dhtml_"+o).getElementsByTagName("div")[0].style.display="none";
}

function dhtmlselect(selectid, selectwidth, optionwidth){
	var selectbox = $(selectid);
	
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect">'+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>');

	document.write('</div></div>');
	selectbox.style.display = "none";
	
	var dhtmlselectbox = $("dhtml_"+selectid);
	
	dhtmlselectbox.style.zIndex = combozindex;
	combozindex--
	
	dhtmlselectbox.getElementsByTagName("div")[0].style.display="none";
	
	dhtmlselectbox.onclick = function(){
		this.getElementsByTagName("div")[0].style.display = "block";
	}
	
	dhtmlselectbox.onmouseover = function(){
		if(interval != null) clearInterval(interval);
	}
	
	dhtmlselectbox.onmouseout = function(){
		interval = setTimeout('closeMenuTeste(\''+selectid+'\');',500);
	}
}