var combodropimage='http://www.ezadmin3.com/templates/t342/images/downbox.gif' //path to "drop down" image
var combodropoffsetY=1 //offset of drop down menu vertically from default location (in px)
var combozindex=100


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

function dhtmlselect(selectid, selectwidth, optionwidth, inner, dir){
	var myInput='';
	var comboSelected = '';
	var dropDownId = '';
	if (selectid=='inp1') {
		myInput='month'; 
		comboSelected='monthValueSelected';
		dropDownId='dropDownMonth';
	} else {
		 myInput='year';
		 comboSelected='yearValueSelected';
		 dropDownId='dropDownYear';
	}
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect"><span id='+comboSelected+'>'+selectbox.title+"</span> "+combodropimage+'<div class="dropdown" id="'+dropDownId+'">')
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="javascript:changeFieldValue(\''+myInput+'\',\''+selectbox.options[i].value+'\');changeText(\''+comboSelected+'\',\''+selectbox.options[i].value+'\');hideByID(\''+dropDownId+'\');">'+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!="")	
		if (!dir) {
		dhtmlselectbox.getElementsByTagName("img")[0].style.right=dhtmlselectbox.offsetWidth+(inner)+"px"
		} else {
		dhtmlselectbox.getElementsByTagName("img")[0].style.left=dhtmlselectbox.offsetWidth+(inner)+"px"
		selectbox.style.marginLeft = "3px";
		}
		
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
	}
}

function dhtmlselect1(selectid, selectwidth, optionwidth, inner, dir){
	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
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	if (combodropimage!="")	
		if (!dir) {
		dhtmlselectbox.getElementsByTagName("img")[0].style.right=dhtmlselectbox.offsetWidth+(inner)+"px"
		} else {
		dhtmlselectbox.getElementsByTagName("img")[0].style.left=dhtmlselectbox.offsetWidth+(inner)+"px"
		selectbox.style.marginLeft = "3px";
		}
		
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
	}
}