
    var dist = [
['Alajuela Airport',[],[],[]],
['Arenal Volcano',[79],[],[]],
['Coco Beach',[149,108],[],[]],
['Dominical Beach',[155,209,204],[],[]],
['Flamingo Beach',[175,136,42,232],[],[]],
['Four Seasons Resort',[156,117,23,210,50],[],[]],
['Herradura Beach',[87,153,135,69,161,141],[],[]],
['Jacó Beach',[92,158,140,64,166,146,5],[],[]],
['La Fortuna',[80,6,111,222,137,117,153,158],[],[]],
['Liberia Airport',[128,89,16,188,42,22,113,124,95],[],[]],
['Manuel Antonio',[137,213,185,19,211,191,56,51,202,163],[],[]],
['Monteverde',[111,0,93,162,119,99,87,107,0,71,143],[],[]],
['Montezuma',[88,154,145,138,151,143,71,76,154,112,127,103],[],[]],
['Nosara Beach',[219,181,87,226,90,97,138,152,181,91,197,96,145],[],[]],
['Ocotal Beach',[152,113,2,206,45,25,137,142,113,24,187,95,147,88],[],[]],
['Papagayo Gulf',[154,115,22,208,48,2,139,144,115,26,189,97,149,94,24],[],[]],
['Paradisus Playa Conchal',[171,132,39,228,4,49,137,153,133,44,198,115,146,85,41,47],[],[]],
['Playa Grande',[175,136,42,231,16,52,142,156,136,47,201,118,149,88,44,50,11],[],[]],
['Potrero Beach',[181,142,43,233,2,53,143,157,137,48,202,119,150,89,45,51,4,15],[],[]],
['Quepos',[132,186,181,23,207,187,52,47,198,159,4,139,123,193,183,185,203,197,207],[],[]],
['Rincon de La Vieja',[151,112,45,205,71,51,136,141,112,23,186,94,146,114,47,49,67,70,71,182],[],[]],
['Samara Beach',[199,161,67,206,70,77,118,132,161,71,177,76,125,17,68,74,65,68,69,173,94],[],[]],
['San Jose',[13,92,160,101,189,169,98,105,168,135,146,114,101,228,162,163,182,185,186,155,161,145],[],[]],
['Tamarindo Beach',[189,138,44,232,16,54,144,158,138,49,203,120,151,90,46,52,12,16,17,199,72,70,187],[],[]],
['Tambor Beach',[0,0,124,0,126,134,0,0,218,128,0,133,0,121,126,131,122,125,126,0,0,101,0,127,],[],[]],
['The Sanctuary Resort',[193,155,61,229,64,71,141,155,184,66,200,99,148,16,63,69,60,63,64,196,89,67,168,65,124,],[],[]]
];

// Distance Calculator with Times and Costs
// copyright 27th April 2006, 20th August 2006 by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code below in this script (including these
// comments) is used without any alteration
function reverse(a, b)
{
	if (a>b) 
	return -1;
	if (a <b) 
	return 1;
	return 0;
	}
function setOptions(id) 
	{
		var selbox = document.getElementById(id);selbox.options.length = 0;
		var ct = []; 
		for (var i = dist.length - 1; i >= 0; i--) 
		
		{
			ct[i] = dist[i][0]+','+i;
			}
			
			ct.sort(reverse); 
			for (var i = dist.length - 1; i >= 0; i--) 
			{
				var c = ct[i].split(','); selbox.options[selbox.options.length] = new Option(c[0],c[1]);
				}
				}
	function calc() 
	{
		var v1 = document.getElementById('From').value;
		var v2 =  document.getElementById('Destination').value;
		var dst = 0;
		if (v1 != v2) 
		{
			dst =dist[Math.max(v1,v2)][1][Math.min(v1,v2)];
			tme = dist[Math.max(v1,v2)][2][Math.min(v1,v2)];
			cst = dist[Math.max(v1,v2)][3][Math.min(v1,v2)];
			}
document.getElementById('m').value = dst;


}
function start() 
{
	setOptions('From');setOptions('Destination');
	}
      	window.onload=start;  
	
