var source=new Array();
var destination=new Array();
var a=0;
var b=0;
function DoCalc(form1,list1,list2) {
if (list1.options[list1.selectedIndex].value == null || list2.options[list2.selectedIndex].value==null) {
alert("Please enter both an Originating and a terminal place.");
}else {
source=list1.options[list1.selectedIndex].value.split("/");
destination=list2.options[list2.selectedIndex].value.split("/");
d=Math.acos(Math.sin(source[2])
*Math.sin(destination[2])
+Math.cos(source[2])
*Math.cos(destination[2])
*Math.cos(source[4]-destination[4]));
a=Math.round(3956.073*d);
if (Math.sin(destination[4]-source[4]) < 0) {
b=Math.acos((Math.sin(destination[2])
-Math.sin(source[2])*Math.cos(d))
/(Math.sin(d)*Math.cos(source[2])));
}
else {
b=2*Math.PI
-Math.acos((Math.sin(destination[2])
-Math.sin(source[2])
*Math.cos(d))/(Math.sin(d)
*Math.cos(source[2])));
}
b=b*(180/Math.PI);
alert("Distance measured is:" +" " + Math.round(a*1.6094) +" "+ "kms.");
   }
}



