<!-- Begin
var Orig=new Array();
var Dest=new Array();
var nm=0;
var tc=0;
function DoCalc(form) {
from_port=form.from.options[form.from.selectedIndex].value;
dest_port=form.to.options[form.to.selectedIndex].value;

if (from_port=="" || dest_port=="") {
alert("Entrez un Point de départ et une Destination!");
}
else {
Orig=from_port.split("/");
Dest=dest_port.split("/");
d=Math.acos(Math.sin(Orig[2])
*Math.sin(Dest[2])
+Math.cos(Orig[2])
*Math.cos(Dest[2])
*Math.cos(Orig[4]-Dest[4]));
nm=Math.round(3437.747*d);
if (Math.sin(Dest[4]-Orig[4]) < 0) {
tc=Math.acos((Math.sin(Dest[2])
-Math.sin(Orig[2])*Math.cos(d))
/(Math.sin(d)*Math.cos(Orig[2])));
} 
else { 
tc=2*Math.PI
-Math.acos((Math.sin(Dest[2])
-Math.sin(Orig[2])
*Math.cos(d))/(Math.sin(d)
*Math.cos(Orig[2])));
}
tc=Math.round(tc*(180/Math.PI));
message=(Orig[0] + " à " + Dest[0] + "\n\n");
message+=("Cap initial vrai :  " +tc+ "\n");
message+=("Milles Nautiques : "+nm+"\n");
message+=("Milles Statutaires : "+Math.round(nm*1.150776515)+"\n");
message+=("Kilomètres : "+Math.round(nm*1.852)+"\n");
message+=(" "+"\n");
message+=("...les distances sont arrondies et à vol d'oiseau"+"\n"+"ces distances sont des (grands-cercles / orthodromies)"+"\n"+"un service de lavoile.com");
alert(message);
   }
}
// End -->