function calculer()
{if(location.href.match("http:\/\/localhost\/websites\/sebeto\/modele-predictif-maya-40.php")||location.hostname.indexOf('sebeto')!=-1){elproduction=document.getElementById("production");elsupnec=document.getElementById("supnec");elsupnecrest=document.getElementById("supnecrest");elsupcultrest=document.getElementById("supcultrest");elsupnecrestbis=document.getElementById("supnecrestbis");elsuprestcycle=document.getElementById("suprestcycle");elsupneccycle=document.getElementById("supneccycle");elsuprestnature=document.getElementById("suprestnature");elbilan=document.getElementById("bilan");ellongcycle=document.getElementById("longcycle");elrobir=document.getElementById("robir");eljurupche=document.getElementById("jurupche");elnukuxche=document.getElementById("nukuxche");eltamanche=document.getElementById("tamanche");dureemilpa=4;valproduction=elproduction.options[elproduction.selectedIndex].value;valsupnec=13410301/valproduction;valsupnecrest=valsupnec-39.13;valsupcultrest=733.84-130.43;valsuprestcycle=(18/dureemilpa-1)*valsupnecrest;valsupneccycle=valsupnecrest+valsuprestcycle;valsuprestnature=valsupcultrest-valsupneccycle;if(valsuprestnature>0){textnature="<span style=\"color: green;\">"+Math.round(valsuprestnature)+" km<sup>2</sup>"+"</span>";textbilan="<span style=\"color: green;\">Tes mayas arrivent à assurer leur subsistance, bravo !</span>";}else{textnature="<span style=\"color: red;\">"+Math.round(valsuprestnature)+" km<sup>2</sup>"+"</span>";textbilan="<span style=\"color: red;\">Ce cycle n'est pas adapté à cette population !</span>";}
if(valsupnecrest<valsupcultrest){d=dureemilpa*valsupcultrest/valsupnecrest;duree=Math.floor(d);textlongcycle="<b>"+duree+"</b> ans, incluant <b>"+(duree-4)+"</b> ans de régénération";}else{textlongcycle="<span style=\"color: red;font-weight: bold;\">Pas assez de terres restantes quelque soit le cycle !</span>";duree=0;}
regenere="<span style=\"color: green;font-weight: bold;\">Régénérée</span>";nonatteint="<span style=\"color: red;font-weight: bold;\">Non atteinte</span>";if(duree>=24){texttamanche=regenere;}else{texttamanche=nonatteint;}if(duree>=14){textnukuxche=regenere;}else{textnukuxche=nonatteint;}if(duree>=8){textjurupche=regenere;}else{textjurupche=nonatteint;}if(duree>=5){textrobir=regenere;}else{textrobir=nonatteint;}
elsupnec.innerHTML=Math.round(valsupnec)+" km<sup>2</sup>";elsupnecrest.innerHTML=Math.round(valsupnecrest)+" km<sup>2</sup>";elsupcultrest.innerHTML=Math.round(valsupcultrest)+" km<sup>2</sup>";elsupnecrestbis.innerHTML=Math.round(valsupnecrest)+" km<sup>2</sup>";elsuprestcycle.innerHTML=Math.round(valsuprestcycle)+" km<sup>2</sup>";elsupneccycle.innerHTML=Math.round(valsupneccycle)+" km<sup>2</sup>";elsuprestnature.innerHTML=textnature;elbilan.innerHTML=textbilan;ellongcycle.innerHTML=textlongcycle;elrobir.innerHTML=textrobir;eljurupche.innerHTML=textjurupche;elnukuxche.innerHTML=textnukuxche;eltamanche.innerHTML=texttamanche;}}

