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



