      function mensualite() {
	var k1,t1;	
        k1=document.form.montant.value;
        t1=document.form.taux.value; 
        n=document.form.duree.value*12; 
	k = k1.replace(",",".");
	t = t1.replace(",",".");
	    if(!k) { var error = "montant"; }
		if(!t) { var error = error + " taux"; }
		if(!n) { var error = error + " duree"; }
		if(error) { alert("Vous n\'avez pas rempli un des champs obligatoire: " + error); }
		else {
			m=k*(t/100)/(1-Math.pow((1+t/100/12),(-n)))/12; 
			m=Math.floor(m*100)/100; 
			document.getElementById('res').style.visibility='visible';
			document.getElementById("result").innerHTML = m;
		}
	
      }
      function frais() {

        k=document.form.bien_prix.value; 
	radio=document.form.bien_age; 
	type=document.form.bien_nature.value

	for (var i=0; i<radio.length;i++) {
         if (radio[i].checked) {
            age=radio[i].value;
         }
	}

	if ((age == '-5ans')||(type =='Terrain + Construction')||(type =='Construction seule')) m=Math.round((((k-30000)/10000)*169)+1905);
	else m=Math.round((((k-30000)/10000)*618)+3253);
  	document.getElementById("bien_frais").value = m;
	
      }
	function popup(url)
	   {
	   html = '<html> <head> <title>Credit Royal de france</title> </head> <body onBlur="top.close()"><IMG src="'+url+'" BORDER=0 NAME=image onLoad="window.resizeTo(document.image.width, document.image.height)"></body></html>';
	   popupImage = window.open('','_blank','toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=1');
	   popupImage.document.open();
	   popupImage.document.write(html);
	   popupImage.document.close()
	   }; 



