var combodropimage='/lumira_header/images/blank.gif'; //path to "drop down" image
var combodropoffsetY=-17 //offset of drop down menu vertically from default location (in px)
var combozindex=100;

if (combodropimage!="")
{
	combodropimage='<img valign=middle class="downimage" src="'+combodropimage+'" title="Select an option" />'
}

function dhtmlselect(selectid, current_community, selectwidth, optionwidth)
{
	var myclass;
	if(current_community==" 1 ")
	{
		myclass = "dhtmlselect_comm";
	}else
	{
		myclass="dhtmlselect_nocomm";
	}
	var selectbox=document.getElementById(selectid);
	document.write('<div id="dhtml_'+selectid+'" class=dhtmlselect><a href="'+selectbox.options[0].value+'" class='+myclass+' >'+selectbox.title+"</a> "+combodropimage+'<div class="dropdown">');
	
	for (var i=0; i<selectbox.options.length; i++)
	{
		if (selectbox.options.length>=2)
   		{
			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;
	}
	//dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px";
	if (combodropimage!="")
	{
		dhtmlselectbox.getElementsByTagName("img")[0].style.left=dhtmlselectbox.offsetWidth+3+"px"
		dhtmlselectbox.onmouseover=function(){
			var myimg = document.getElementById('img_'+selectid);
			myimg.src = "/lumira_header/images/hov.gif";
			if (selectbox.options.length>=2)
   			{
				this.getElementsByTagName("div")[0].style.display="block";
				this.getElementsByTagName("div")[0].style.top="15px";
			}
		}
		dhtmlselectbox.onmouseout=function(){
			var myimg = document.getElementById('img_'+selectid);
			if(current_community==" 1 "){
				myimg.src = "/lumira_header/images/hov.gif";
			}else{
				myimg.src = "/lumira_header/images/blank.gif";
			}
			this.getElementsByTagName("div")[0].style.display="none";
			
		}
	}
}
