function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareInputsForHints() {
	//idem pour les images
	var images = document.getElementsByTagName("img");
	for (var i=0; i<images.length; i++){
		if (images[i].className=='img_aide_form')
		{
			// test to see if the hint span exists first
			if (images[i].parentNode.getElementsByTagName("span")[0]) {
				// the span exists!  on focus, show the hint
				images[i].onmouseover = function () {
					hideAllInputs();
					this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
				}
				// when the cursor moves away from the field, hide the hint
				images[i].onmouseout = function () {
					window.setTimeout("hideAllInputs()", 100);
				}
			}
		}
	}
}


function hideAllInputs()
{
	var spans = document.getElementsByTagName("span");
	for (var i=0; i<spans.length; i++)
	{
		if ( (spans[i].className=='hint')|| (spans[i].className=='hintage') || (spans[i].className=='hint hint_color') || (spans[i].className=='hintage hint_color') || (spans[i].className=='hintage_unique') || (spans[i].className=='hintage_unique hint_color'))
		{
			spans[i].style.display='none';
		}
	}
	/*for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			inputs[i].parentNode.getElementsByTagName("span")[0].style.display = "none";
			
		}
	}*/
}

