// JavaScript Document
function WMOpen(f,nom, h, w, scroll) {
  var PosLeft = screen.width;
  var PosTop = screen.height;
  PosLeft = ((PosLeft/2)-((w+10)/2))
  PosTop = ((PosTop/2)-((h+59)/2))
  var myPopup = window.open(f, nom, 'resizable=no,scrollbars=' + scroll + ',left=' + PosLeft + ',top=' + PosTop + ',menubar=no,status=no,width=' + w + ',height=' + h);
  if(myPopup.focus){myPopup.focus();}
}
	function format(valeur) {
		var cents = Math.round(valeur*100) - Math.floor(valeur)*100;
		if (cents < 10) {cents = "0" + String(cents) ;}
		if (cents==100) {cents = "00";valeur = valeur+1; }
	
		valeur = Math.floor(valeur) + "," + cents;
		return valeur;
	}
	function replace(texte,recherche,remplacement) {
		if (recherche != remplacement && recherche.length > 0 ) {
			fin = texte.indexOf(recherche,0);
			while (fin >= 0) {
			texte =  texte.substring(0,fin)+remplacement+texte.substring(fin+recherche.length,texte.length); 
			fin = texte.indexOf(recherche,0); } }
		return texte; }
		
	function formatCurrency(num) {
		num = num.toString().replace(/\$|\,/g,'');
		if(isNaN(num))
		num = "0";
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
		if(cents<10)
		cents = "0" + cents;
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+' '+
		num.substring(num.length-(4*i+3));
		return (((sign)?'':'-') + num + ',' + cents);
	}
