function soumettre_liste_choix(sElementName){
	oListeCheckboxes = document.getElementsByTagName('input');
	if(typeof(oListeCheckboxes) == 'undefined') return;

	aListeId = new Array();
	aListeLabels = new Array();

	for(iIndex = 0 ; iIndex < oListeCheckboxes.length ; iIndex ++){

		if(String(oListeCheckboxes[iIndex].type).toLowerCase() != 'checkbox') continue;

		if(oListeCheckboxes[iIndex].checked){
			aListeId[aListeId.length] = oListeCheckboxes[iIndex].value;
			oElementLabel = document.getElementById('label_' + oListeCheckboxes[iIndex].id);

			if(typeof(oElementLabel) != 'undefined'){
				aListeLabels[aListeLabels.length] = oElementLabel.innerHTML;
			}
		}
	}

	if(oElementInput = top.document.getElementById(sElementName)){
		oElementInput.value = aListeId.join(',');
	}

	if(oElementTexte = top.document.getElementById('text_' + sElementName)){
		oElementTexte.innerHTML = aListeLabels.join('<br />');
	}

	top.Shadowbox.close();
}

function open_liste_choix(sUrl,sIdElementChoix){
	if(!(oElementListeChoix = document.getElementById(sIdElementChoix))) return false;
	Shadowbox.open({
	  content:    sUrl + '&preselection='+oElementListeChoix.value,
	  player:     "iframe",
	  width:			839
		});
}
 
function localiser(sDivAddressElement){
	if(!(oDivAddress = document.getElementById(sDivAddressElement))) return false;
	if(!(oDivAddressMap = document.getElementById(sDivAddressElement + "_map"))){
		if(!(oDivAddressMap = document.getElementById("localisation_map"))){
			return false;
		}
	}
	
	address = oDivAddress.innerHTML;
	address = address.replace(/<!--[^(-->)]+-->/g, '');
	address = address.replace(/^\s+/mgi,'');

	addressToDisplay = address;
	addressToDisplay = addressToDisplay.replace(/<\/?dd[^>]*>/mgi,' ');
	addressToDisplay = addressToDisplay.replace(/<\/?[^>]+>/mgi,' ');
	addressToDisplay = addressToDisplay.replace(/\n/mgi,'<br />').replace(/^[ \t]+/mgi,' ').replace(/[ \t]+$/mgi,' ').replace(/^[ \t]+/mgi,'').replace(/[ \t]+$/mgi,'');
	address = address.replace(/\<dd class\=\"?notinaddress\"?\>.*\<\/dd\>/gmi,'');
	address = address.replace(/\n/mgi,'');
	address = address.replace(/<\/?[^>]+>/mgi,' ')
	address = address.replace(/^[ \t]+/mgi,' ').replace(/[ \t]+$/mgi,' ').replace(/^[ \t]+/mgi,'').replace(/[ \t]+$/mgi,'');

	if(address == ''){
		alert('Adresse vide.');
		return;
	}
	
	sContenu = '<div style="margin:10px;>' + addressToDisplay + '</div>';
	
	if (GBrowserIsCompatible()) {
		var map = new GMap2(oDivAddressMap,{size: new GSize(290,290)});
		
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());

		var geocoder = new GClientGeocoder();
	
	  geocoder.getLatLng(
	    address,
	    function(point) {
	      if (!point) {
	        alert(address + " : adresse non trouvée.");
	      } else {
	        map.setCenter(point, 13);
	        var marker = new GMarker(point);
	        map.addOverlay(marker);
	        marker.openInfoWindowHtml(sContenu);
	      }
	    }
	  );
	}

}

function blurLink(oCallObj){
}


function redirectSelectedIndex(callElement){
	if(callElement.options[callElement.selectedIndex].value!=''){
		window.location=callElement.options[callElement.selectedIndex].value;
	}
}

