function mensualite() 
{
	k=document.formu.capital.value;
	t=document.formu.taux.value;
	n=document.formu.nb_mens.value * 12;

	if ((t>0) && (k>0) && (n>0))
	{
		m=k*(t/100)/(1-Math.pow((1+t/100/12),(-n)))/12;
		m=Math.floor(m*100)/100;
		document.formu.mens.value=m;
	}
	else 
	{
		alert("Veuillez choisir un taux, un capital et un nombre d'années différents de 0.");
	}

}


function popup(url,w,h,sb,rz,nom)
{
		var parametres = 'status=no,toolbar=no,menubar=no,location=no,scrollbars=' + sb + ',resize=' + rz + ',width=' + w + ',height=' + h + ',resizable=' + rz;
		lapopup = window.open(url,nom,parametres);
    		if (!lapopup) alert("Veuillez désactiver votre filtre anti-popup pour pouvoir consulter cette page");
}


function voirFiche(id)
{

	nomPopup = "m" + id;
	id = "modeles/" + id + ".htm";
	popup(id,750,690,"auto","yes",nomPopup);

}


function voirChantier()
{
	var cible = "voirChantier.php?login=" + document.formu.login.value + "&mpasse=" + document.formu.mpasse.value;
	
	if (document.formu.enregistrer.checked == true)
	{
		cible += "&enregistrer=ON";
	}
	else
	{
		cible += "&enregistrer=OFF";
		
	}
	
	
	popup(cible,screen.availWidth,screen.availHeight,'yes','yes','chantier');
}

window.defaultStatus = "Conception © 2007 idegrif.com ";


/****************************************/
/* Fonctions se substitution des images */
/*****************************************/

function bouton(SrcBoutonNormal,SrcBoutonSurvol)
{
 //SrcBoutonNormal : source du bouton initial
 //SrcBoutonSurvol : source du bouton au survol
 
 this.SN = SrcBoutonNormal;
 this.SS = SrcBoutonSurvol;
}


var TabBoutons = new Array();

TabBoutons[0] = new bouton('images/bn_catalogue.gif','images/bn_catalogue_on.gif');
TabBoutons[1] = new bouton('images/bn_presta.gif','images/bn_presta_on.gif');
TabBoutons[2] = new bouton('images/bn_vv.gif','images/bn_vv_on.gif');
TabBoutons[3] = new bouton('images/bn_financement.gif','images/bn_financement_on.gif');
TabBoutons[4] = new bouton('images/bn_terrains.gif','images/bn_terrains_on.gif');
TabBoutons[5] = new bouton('images/bn_monchantier.gif','images/bn_monchantier_on.gif');
TabBoutons[6] = new bouton('images/bn_contact.gif','images/bn_contact_on.gif');
TabBoutons[7] = new bouton('images/bn_notice.gif','images/bn_notice_on.gif');
TabBoutons[8] = new bouton('images/bn_garanties.gif','images/bn_garanties_on.gif');
TabBoutons[9] = new bouton('images/bn_partenariats.gif','images/bn_partenariats_on.gif');
TabBoutons[10] = new bouton('images/bn_contrat.gif','images/bn_contrat_on.gif');
TabBoutons[11] = new bouton('images/bn_lagence.gif','images/bn_lagence_on.gif');
TabBoutons[12] = new bouton('images/bn_historique.gif','images/bn_historique_on.gif');
TabBoutons[14] = new bouton('images/bn_news.gif','images/bn_news_on.gif');
TabBoutons[15] = new bouton('images/bn_realisations.gif','images/bn_realisations_on.gif');


function echange(n)
{ 
  document.images['img'+n].src = TabBoutons[n].SS;
} 


function retablit(n)
{ 
 document.images['img'+n].src = TabBoutons[n].SN;
}


/***********************************/
/* Fonctions de preload des images */
/***********************************/

function preCharge()
{
 if (document.images)
  {
   var TabImages = new Array();
    for (var i=0; i<preCharge.arguments.length; i++)
     {
      TabImages[i] = new Image;
      TabImages[i].src = preCharge.arguments[i];
     }
   }
}
