function swapDiv(thisDiv) {
	if(document.getElementById(thisDiv).style.display=='none')
		document.getElementById(thisDiv).style.display='block';
	else
		document.getElementById(thisDiv).style.display='none';
}
function nouvelle_fenetrage(src,name,w,h){
   size= ",width=" + w + ",height=" + h;
   browser=window.open(src,name,"scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no, left=200, top=200, location=no,directories=no"+size);
   window.onerror = null;
 }

function upload(rep,frm,chps,nom){
   var src = "upload.php?rep="+rep+"&frm="+frm+"&chps="+chps+"&nom="+nom
   size= ",width=400,height=300";
   browser=window.open(src,"pop_upload","scrollbars=no,resizable=no,toolbar=no,status=no,menubar=no,left=300,top=300,location=no,directories=no"+size);
   window.onerror = null;
}
function swapBold(thisId) {
		if(document.getElementById(thisId).className=='isBold') {
			document.getElementById(thisId).className='isNormal';
		}
		else {
			document.getElementById(thisId).className='isBold';
		}
}
function number_format (number, decimals, dec_point, thousands_sep)
{
  var exponent = "";
  var numberstr = number.toString ();
  var eindex = numberstr.indexOf ("e");
  if (eindex > -1)
  {
    exponent = numberstr.substring (eindex);
    number = parseFloat (numberstr.substring (0, eindex));
  }
  
  if (decimals != null)
  {
    var temp = Math.pow (10, decimals);
    number = Math.round (number * temp) / temp;
  }
  var sign = number < 0 ? "-" : "";
  var integer = (number > 0 ? 
      Math.floor (number) : Math.abs (Math.ceil (number))).toString ();
  
  var fractional = number.toString ().substring (integer.length + sign.length);
  dec_point = dec_point != null ? dec_point : ".";
  fractional = decimals != null && decimals > 0 || fractional.length > 1 ? 
               (dec_point + fractional.substring (1)) : "";
  if (decimals != null && decimals > 0)
  {
    for (i = fractional.length - 1, z = decimals; i < z; ++i)
      fractional += "0";
  }
  
  thousands_sep = (thousands_sep != dec_point || fractional.length == 0) ? 
                  thousands_sep : null;
  if (thousands_sep != null && thousands_sep != "")
  {
	for (i = integer.length - 3; i > 0; i -= 3)
      integer = integer.substring (0 , i) + thousands_sep + integer.substring (i);
  }
  
  return sign + integer + fractional + exponent;
}