function toggleItem(box) {
    if (document.getElementById('info_'+box).style.display == 'none') {
        document.getElementById('info_'+box).style.display = 'block';
    } else {
        document.getElementById('info_'+box).style.display = 'none';
    }
}

function PopInfo(file,width,height) {
  var top=(screen.height-height)/2;
  var left=(screen.width-width)/2;
   window.open(file,"","top="+top+",left="+left+",width="+width+",height="+height+",menubar=no,scrollbars=yes,statusbar=no");
   return false;
}

function KeyPopInfo(file,width,height) {
	if(event.keyCode == 13){
	  var top=(screen.height-height)/2;
  	var left=(screen.width-width)/2;
   	window.open(file,"","top="+top+",left="+left+",width="+width+",height="+height+",menubar=no,scrollbars=yes,statusbar=no");
   	return false;
   }
   else
   {return(true);}
}

function changelinks() {
  for (i = 0; i < document.links.length; i++) {
    if (document.links[i].getAttribute('class') == 'newwindow'
      || document.links[i].className == 'newwindow') {
      document.links[i].setAttribute('target', '_blank');
    }
  }
}
window.onload = changelinks;

function limit(inputencours,message)
{
	var monbloc = document.getElementById("form_indic");
	var mesinputs = document.getElementsByTagName("input");
	var intchecked=0;
	for (var i=0; i<mesinputs.length; i++)
	{
	  if (mesinputs[i].type.toLowerCase()=="checkbox") 
	  {
	  	if (mesinputs[i].checked)
		{
			intchecked++;
		}
	  }
	}
	if (intchecked>8)
	{
		inputencours.checked=false;
		alert(message);
		return false;
	} 
	else
	{
		return true;
	}
}
