function decorerLabels() {

	var labels = $$('label');

	for (var index = 0; index < labels.length; ++index) {

		var label = labels[index];

		if (label.accessKey) {

			var ak = label.accessKey.toUpperCase();

			decorerAccessKey(label, ak);

		}

		if (label.htmlFor) {

			var elt = document.getElementById(label.htmlFor);

			if (!elt) continue;

//			if (elt.id.match(/Req/)) label.className += ' requis';

			if (elt.id.match(/Req/)) label.appendText('*');

		}

	}

} // decorerLabels

function decorerAccessKey(elt, key) {

	if ('element' == $type(elt)) {

		var node = elt.firstChild;

		while (node && !decorerAccessKey(node, key)) node = node.nextSibling();

		return node;

	}

	if ('textnode' != $type(elt)) return false;

	var pos = elt.nodeValue.toUpperCase().indexOf(key);

	if (-1 == pos) return false;
	
	var suffix = elt.nodeValue.substring(pos + 1);
	
	var akSpan = new Element('span', {'class' : 'accessKey'}).set('text', elt.nodeValue.charAt(pos));
	
	elt.nodeValue = elt.nodeValue.substring(0, pos);
	
	akSpan.inject(elt.parentNode, 'bottom');
	
	elt.parentNode.appendText(suffix);

	return true;

}
//AJOUT BS
function chercherOrganisation(nom)
{ 
	var xhr; 
	try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
	catch (e) 
	{
		try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
		catch (e2) 
		{
		  try {  xhr = new XMLHttpRequest();     }
		  catch (e3) {  xhr = false;   }
		}
	 }
 
	xhr.onreadystatechange  = function()
	{ 
		 if(xhr.readyState  == 4)
		 {
		
			if(xhr.status  == 200) 
			if( xhr.responseText ==  1)
			{
			
				var rep =  'Il existe une organisation de nom identique';
				document.getElementById('reponseRechOrg').innerHTML = rep;
				return false;

			}else
			{
				document.getElementById('reponseRechOrg').innerHTML = '';
				return true;
			}
			  
		 }
	}; 


	
	var url = "spip.php?page=chercherOrganisation&nom="+nom;
   xhr.open( "GET", url,  true); 
   xhr.send(null); 
} 

function verficationContact ()
{
	var overlay = null;

	if($('formDocuments'))
	{
		new FormCheck('formDocuments', {
			
			display : {

				errorsLocation : 1,
				indicateErrors : 2,
				keepFocusOnError : 1,
				closeTipsButton : 0,
				showErrors : 0
			}
		})
	}		
}