/***********************************************
* DHTML Select Menu- by JavaScript Kit (www.javascriptkit.com) / updated for soopermarkt.de
* Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/ 
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

var combodropimage = ''; //'images/buttons/select_downarrow.jpg'; 
var combodropoffsetY = 2; //offset of drop down menu vertically from default location (in px)
var combozindex = 100;7

if (combodropimage!="")	
	combodropimage='<img class="downimage" src="'+combodropimage+'" title="Bitte wählen Sie eine Option!"/>';

	
function dhtmlselect(selectid, selectwidth, optionwidth) {
	
	var selectbox = document.getElementById(selectid);
	
	document.write('<div id="dhtml_'+selectid+'" class="dhtmlselect">' +
		'<span id="selecttitle" class="selecttitle">'+selectbox.title+'</span>' +
		combodropimage + 
		'<div id="dropdown_'+selectid+'" class="dropdown">');
	
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="'+selectbox.options[i].value+'" title="'+selectbox.options[i].text+'">'+selectbox.options[i].text+'</a>');
	
	document.write('</div></div>');
	
	selectbox.style.display = "none";
	
	
	var dhtmlselectbox = document.getElementById("dhtml_"+selectid);
	var selecttitle = document.getElementById("selecttitle");
	
	dhtmlselectbox.style.zIndex = combozindex;
	combozindex--;
	
	if (typeof selectwidth!="undefined") {
		dhtmlselectbox.style.width = selectwidth;
		selecttitle.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+0+"px";
	
	
	var timeout = null;
	dhtmlselectbox.onmouseover=function() {
		this.getElementsByTagName("div")[0].style.display = "block";
		
		try{
			if (timeout!=null) {
				window.status='clear';
				timeout.clearTimeout();
			}
		} catch(e) {}
	}
	
	dhtmlselectbox.onmouseout=function() {
		this.getElementsByTagName("div")[0].style.display = "none";
		//timeout = setTimeout("document.getElementById(\"dropdown_"+selectid+"\").style.display = \"none\"; timeout=null;", 1000);
	}
	
}
