/********************* EasyDropdown Script V0.8 **********************/
/******************** CREATED BY MLADEN STEPANIC *********************/
/*********** Usage of this script is, indeed, very simple ************/
/******** Find element that you want to act as select button *********/
/** and give it onclick attribute that will call dropdown function,***/
/************************ something like this: ***********************/
/**** onclick="dropdown('selectbtnID','listID','listHoverClass)" *****/
/*********************************************************************/


function dropdown(container,list,classname){
	var box = document.getElementById(container);
	var list = document.getElementById(list);
	
 	box.onClick = showList(list);	
	rollover(box,list,classname); 
	
	 
	function showList(dd){
	// when clicked on button, shows or hides the ul element
		if (dd.style.display == 'none'){
			dd.style.display = '';
		}else{
			dd.style.display = 'none';
		}
	}
	
	function rollover(box,dd,classname){
	// applies hover effect and changes value of select simulation button
		var x = dd.getElementsByTagName('LI');

		for (var i=0;i<x.length;i++){
			x[i].onmouseover = function(){this.className = classname};
			x[i].onmouseout = function(){this.className = ''};
			x[i].onclick = 	function()  {
											dd.style.display = 'none';
											box.innerHTML = this.innerHTML;						
										}
		}
	}
}











