	var activeControl = '';
	var selectedControl = '';
	var mouseOut = false;
	var disableColor = '#cccccc';
  
	var selectedItem = Array();
	var disabledItems = Array();
	var itemHeights = Array();
	var listHeights = Array();
	var keepClosed = Array();  
  
	function bodyclick() {
		
		if(mouseOut && activeControl!='') {
			combobox_click(activeControl);
		}
	}
  
	function combobox_enable(control, v) {

		disabledItems[control] = !v;

		if(v) {
			document.getElementById('combobox_'+control).style.color = 'black'; 
			document.getElementById(control+'_dropdownimage').src = 'image/acti.jpg';
		} else {
			document.getElementById(control+'_dropdownimage').src = 'image/acti.jpg';
			document.getElementById('combobox_'+control).style.color = disableColor;
			if(selectedControl!='') {
				document.getElementById('selection2_'+selectedControl).style.background = 'white';
			}
		}
	}
  
	function combobox_getEnabled(control) {
		return !disabledItems[control];
	}
  
	function combobox_click(control,numbers){
		var items = document.getElementById('stepactive').value;
		if(items==5){
			var Data = new Array();Data = control.split('frmModel');
			var numbers = document.getElementById('active_id_'+Data[1]).value;
		/*	if(items==5 && document.getElementById('checkSaleItems'+numbers).checked==false){
				alert("Vous devez vérifier avant de choisir un âge");	
				return;
			}*/
		}
		
		if(!combobox_getEnabled(control) || (typeof(keepClosed[control]) != undefined && keepClosed[control] == true))
			return;
		if(selectedControl!='') {
			document.getElementById('selection2_'+selectedControl).style.background = 'white';
		}
		document.getElementById('selection2_'+control).style.background = '#cccccc';
		selectedControl = control;
		mouseOut = false;
		if(activeControl!='') {
			document.getElementById('list'+activeControl).style.display='none';
			if(activeControl==control) {
				activeControl = '';
				return;
			}
		}
		if(document.getElementById('list'+control).style.display=='block') {
			document.getElementById('list'+control).style.overflow='hidden';
			document.getElementById('list'+control).style.display='none';
			document.getElementById('list'+control).style.display='none';
			
		} else {
			document.getElementById('list'+control).style.display='block';
			document.getElementById('list'+control).style.overflow='auto';
			document.getElementById('list'+control).style.display='block';
			document.getElementById('selection_'+control).style.backgroundColor = 'white';

			
			if(selectedItem[control]!="") {
				if(document.getElementById(control+'_item_'+selectedItem[control])) {
					document.getElementById(control+'_item_'+selectedItem[control]).style.backgroundColor = '#cccccc';
					document.getElementById(control+'_item_'+selectedItem[control]).style.border = '1px dashed #555555';
				}
			}
			
			activeControl = control;
		}
	}
	
	function combobox_item_mouseover(control, id) {
		mouseOut = false;
		document.getElementById(control+'_item_'+id).style.backgroundColor = '#aaaaaa';
		//document.getElementById(control+'_item_'+id).style.border = '1px dashed #555555';
	}
  
	function combobox_item_mouseout(control, id) {
		mouseOut = true;
		document.getElementById(control+'_item_'+id).style.backgroundColor = 'white';
		//document.getElementById(control+'_item_'+id).style.border = '1px solid white';
	}
  
	function combobox_mouseout(control) {
		mouseOut = true;
	}
  
	function combobox_set_value(control, id) {
		document.getElementById('display'+control).innerHTML = document.getElementById(control+'_text_'+id).innerHTML;

		if(document.getElementById('image'+control)) {
			document.getElementById('image'+control).src = document.getElementById(control+'_image_'+id).src;
		}
		document.getElementById(control).value = id;
		// unset old selection
		if (selectedItem[control] != "") {
			if (document.getElementById(control + '_item_' + selectedItem[control])) {
				document.getElementById(control + '_item_' + selectedItem[control]).style.backgroundColor = 'white';
				document.getElementById(control + '_item_' + selectedItem[control]).style.border = '1px solid white';
			}
		}
		// set new selection
		selectedItem[control] = id;
	}
  
	function combobox_set_item_text(control, id, text) {
		document.getElementById(control+'_text_'+id).innerHTML = text;
		if(selectedItem[control] == id) {
			combobox_set_value(control, id);
		}
	}
  
	function combobox_item_click(control,id) {
      	    
		if(selectedItem[control]!="") {
			if(document.getElementById(control+'_item_'+selectedItem[control])) {
				document.getElementById(control+'_item_'+selectedItem[control]).style.backgroundColor = 'white';
				document.getElementById(control+'_item_'+selectedItem[control]).style.border = '1px solid white';
			}
		}
					
		combobox_click(control);
		selectedItem[control] = id;
        
		combobox_set_value(control, id);

	}
	
	function combobox_item_hide(control, id, defaultchoice) {
		document.getElementById(control+'_item_'+id).style.display = 'none';
		document.getElementById(control+'_item_'+id).style.height = '0px';
		document.getElementById('list'+control).style.height = listHeights[control].replace("px","") - itemHeights[control].replace("px","") + "px";

		combobox_set_value(control, defaultchoice);
		
	}

	function combobox_item_unhide(control, id) {
	
		document.getElementById(control+'_item_'+id).style.display = 'block';
		document.getElementById(control+'_item_'+id).style.height = itemHeights[control];
		document.getElementById('list'+control).style.height = listHeights[control];	
	}

