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