<!--
titre="Simulez vos crédits";
fond1='lightyellow';
NumChars = "0123456789";
NumDec = "0123456789,.";
AlphaChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
monnaie = "Francs";
euro = 6.55957;
valid = true;
test_data = true;
posvirgule = "";

function affiche_ico_fr_euro()
{eval("document.icofreuro.src = '../imgdivfr/toggle/"+valeurico+".gif'");

}
function affiche_monnaie()
{for(var i=1;i<=nbreimg;i++)
 {eval("document.img"+i+".src = '../imgdivfr/toggle/"+valeurimg+".gif'");}
}
function suivant()
{if(((!valid)||(!test_data)) && (fieldValue!=""))
 {eval("document.formulaire."+fieldName+".focus()");}
}

function test_entier(field)
{var c;
 valid = true;
 test_data = true;
 msg="Veuillez entrer une valeur entière...";
 fieldName = field.name;
 fieldValue = field.value;
 if(!fieldValue)
  {valid = false;
   efface_calcul();
  }
 if(fieldValue!="")
  {for (var x = 0; x < field.value.length; x++)
   {if(valid)
    {c =field.value.charAt(x);valid=(NumChars.indexOf(c) != -1);}
   }
   if(valid)
    {check_field();}
   if((!valid)||(!test_data))
    {alert(msg);
     eval("document.formulaire."+fieldName+".value=''");
     efface_calcul();
    } 
   if((valid)&&(test_data))
    {efface_calcul();}
  }
}
function test_decimal(field)
{var c;
 valid = true;
 test_data = true;
 posvirgule = "";
 msg="Veuillez entrer une valeur entière ou décimale...";
 fieldName = field.name;
 fieldValue = field.value;
 if(!fieldValue)
  {valid = false;
   efface_calcul();
  }
 if(fieldValue!="")
  {for (var x = 0; x < field.value.length; x++)
   {if(valid)
    {c =field.value.charAt(x);valid=(NumDec.indexOf(c) != -1);
     if((c ==".") || (c == ","))
      {if((x == 0) || (x == field.value.length - 1))
        {valid = false;posvirgule = "";}
       else
        {posvirgule = x;}
      }
     }
    }
   if(valid)
    {if(posvirgule!="")
     {arrondir(fieldValue);
      eval("document.formulaire."+fieldName+".value="+fieldValue+"");
     } 
     check_field();
    }  
   if((!valid)||(!test_data))
    {alert(msg);
     eval("document.formulaire."+fieldName+".value=''");
     efface_calcul();
    }
   if((valid)&&(test_data))
    {efface_calcul();} 
  }
}
function arrondir(valeur)
{valeur = "" + valeur;
 len = valeur.length;
 valeur = valeur.substring(0,posvirgule) + "." + valeur.substring(posvirgule+1, len);
 valeur = 1*valeur;
 if(valeur > 0)
 {tmp = valeur*100;
  tmp = Math.round(tmp);
  strtmp = "" + tmp;
  len = strtmp.length;
  valeur= strtmp.substring(0, len - 2) + "." + strtmp.substring(len -2, len);
  }
 else {valeur="";}
 fieldValue=valeur;
}
function entier2()
{if(val > 0)
 {tmp = val*100;
  tmp = Math.round(tmp);
  strtmp = "" + tmp;
  len = strtmp.length;
  dec = strtmp.substring(len -2, len)*1;
  if(dec > 50)
  {val= strtmp.substring(0, len - 2)*1 + 1;}
  if( dec <= 49)
  {val= strtmp.substring(0, len - 2)*1 }
  }
 else {val=0}
}
function arrondir2()
{if(val > 0)
 {tmp = val*100;
  tmp = Math.round(tmp);
  strtmp = "" + tmp;
  len = strtmp.length;
  val= strtmp.substring(0, len - 2) + "." + strtmp.substring(len -2, len);
  }
 else {val=0}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
// -->