	var air = new Array("San Francisco Airport","San Jose Airport","Oakland Airport","San Francisco");
		
		var specialDestinations = new Array();
		specialDestinations["San Francisco Airport"] = 1;
		specialDestinations["San Jose Airport"] = 2;
		specialDestinations["Oakland Airport"] = 3;
		specialDestinations["San Francisco"] = 4;
		
	//start typing cities here one by one same as example
	var cities = new Array(
	"Alameda",								
	"Alamo",									
	"Albany",									
	"Antioch",								
	"Atherton",								
	"Belmont",								  
	"Berkeley",								
	"Burlingame",								
	"Campbell",								
	"Castro Valley",							
	"Clayton",								
	"Concord",								
	"Crocket",								
	"Cupertino",								
	"Corta Madera",							
	"Danville",								
	"Diablo",									
	"Belmont",								
	"Dublin",									
	"El Cerrito",								
	"El Sobrante",							
	"Emeryville",								
	"Fairfax",								
	"Foster City",							
	"Fremont",								
	"Gilroy",									
	"Hayward",								
	"Half Moon Bay",							
	"Ignacio",								
	"Kensington",								
	"Ladera",									
	"Lafayette",								
	"La Honda",								
	"Larkspur",								
	"Livermore",								
	"Los Altos",								
	"Los Altos Hills",						
	"Los Gatos",							
	"Marin City",								
	"Martinez",								
	"Menlo Park",								
	"Mill Valley",							
	"Milpitas",								
	"Morgan Hill",							
	"Moraga",									
	"Monterey",								
	"Monte Sereno",							
	"Mountain View",							
	"Murwoods",								
	"Napa",									
	"Newark",									
	"Navato",									
	"Oakland",								
	"Orinda",									
	"Palo Alto",								
	"Piedmont",								
	"Pinole",									
	"Pleasant Hill",							
	"PLeasenton",								
	"Pittsburg",								
	"Portola Valley",							
	"Redwood City",							
	"Redwood Shores",							
	"Richmond",								
	"Rodeo",									
	"Ross",									
	"Sacramento",								
	"San Anselmo",							
	"San Carlos",								
	"Santa Clara",							
	"San Francisco",							
	"San Jose North",							
	"San Jose South",							
	"San Leandro",							
	"San Lorenzo",							
	"San Mateo",							
	"San Pablo",								
	"San Quentin",							
	"San Rafael",								
	"San Ramon",							
	"Saratoga",						
	"Sausalito",								
	"Sharon Heights",							
	"Stanford",								
	"Stinson Beach",							
	"Sunol",									
	"Sunnyvale",								
	"Terra Linda",							
	"Tiburon",								
	"Walnut Creek",							
	"Woodside",								
	"Yosemite",							
	"Union City"	 );
	// last one NO comma -- NO ,   	
	
	//start typing prices here same way = 1st price is from city to sfo , 2nd from city to sjc etc etc read below
	var prices = new Array();
	// do NOT change order or AIR array  first one  var air = new Array <-- do not change it
	//     CITY !!!Type SAME As!!! in cities Array     	PRICES 1= San Francisco Airport 2= San Jose Airport 3=Oakland Airport 4= San Francisco same as in air 
	prices["Alameda"] = 								([0, 85, 135, 75, 65]);
	prices["Alamo"] = 									([0, 135, 125, 125, 105]);
	prices["Albany"] = 									([0, 85, 165, 85, 65]);
	prices["Antioch"] = 								([0, 145, 195, 145, 125]);
	prices["Atherton"] = 								([0, 85, 105, 95, 85]);
	prices["Belmont"] = 								([0, 75, 105, 85, 75]);  
	prices["Berkeley"] = 								([0, 85, 135, 75, 65]);
	prices["Burlingame"] = 								([0, 65, 105, 85, 65]);
	prices["Campbell"] = 								([0, 125, 105, 125, 125]);
	prices["Castro Valley"] = 							([0, 95, 115, 95, 85]);
	prices["Clayton"] = 								([0, 35, 155, 125, 105]);
	prices["Concord"] = 								([0, 125, 155, 115, 105]);
	prices["Crocket"] = 								([0, 135, 195, 115, 105]);
	prices["Cupertino"] = 								([0, 105, 105, 115, 105]);
	prices["Corta Madera"] = 							([0, 95, 165, 105, 75]);
	prices["Danville"] = 								([0, 125, 125, 115, 105]);
	prices["Diablo"] = 									([0, 125, 135, 125, 105]);
	prices["Dublin"] = 									([0, 125, 115, 105, 105]);
	prices["El Cerrito"] = 								([0, 95, 185, 95, 75]);
	prices["El Sobrante"] = 							([0, 95, 155, 95, 85]);
	prices["Emeryville"] = 								([0, 85, 155, 75, 65]);
	prices["Fairfax"] = 								([0, 105, 185, 105, 85]);
	prices["Foster City"] = 							([0, 75, 105, 85, 75]);
	prices["Fremont"] = 								([0, 115, 115, 95, 105]);
	prices["Gilroy"] = 									([0, 205, 155, 205, 225]);
	prices["Hayward"] = 								([0, 95, 115, 85, 95]);
	prices["Half Moon Bay"] = 							([0, 105, 115, 115, 105]);
	prices["Ignacio"] = 								([0, 115, 175, 115, 95]);
	prices["Kensington"] = 								([0, 95, 145, 85, 85]);
	prices["Ladera"] = 									([0, 95, 105, 115, 105]);
	prices["Lafayette"] = 								([0, 105, 145, 95, 85]);
	prices["La Honda"] = 								([0, 115, 125, 135, 115]);
	prices["Larkspur"] = 								([0, 95, 155, 105, 75]);
	prices["Livermore"] = 								([0, 135, 115, 115, 125]);
	prices["Los Altos"] = 								([0, 105, 105, 105, 105]);
	prices["Los Altos Hills"] = 						([0, 105, 105, 105, 105]);
	prices["Los Gatos"] = 								([0, 135, 115, 135, 135]);
	prices["Marin City"] = 								([0, 85, 145, 105, 75]);
	prices["Martinez"] = 								([0, 135, 145, 115, 105]);
	prices["Menlo Park"] = 								([0, 85, 105, 95, 85]);
	prices["Mill Valley"] = 							([0, 95, 155, 105, 75]);
	prices["Milpitas"] = 								([0, 115, 105, 105, 115]);
	prices["Morgan Hill"] = 							([0, 165, 135, 165, 175]);
	prices["Moraga"] = 									([0, 105, 145, 95, 85]);
	prices["Monterey"] = 								([0, 335, 255, 335, 325]);
	prices["Monte Sereno"] = 							([0, 115, 105, 125, 135]);
	prices["Mountain View"] = 							([0, 95, 105, 115, 95]);
	prices["Murwoods"] = 								([0, 135, 175, 145, 105]);
	prices["Napa"] = 									([0, 225, 255, 225, 195]);
	prices["Newark"] = 									([0, 95, 105, 95, 95]);
	prices["Navato"] = 									([0, 115, 205, 115, 95]);
	prices["Oakland"] = 								([0, 85, 125, 75, 65]);
	prices["Orinda"] = 									([0, 105, 135, 85, 85]);
	prices["Palo Alto"] = 								([0, 85, 105, 95, 85]);
	prices["Piedmont"] = 								([0, 85, 135, 85, 75]);
	prices["Pinole"] = 									([0, 115, 145, 85, 95]);
	prices["Pleasant Hill"] = 							([0, 125, 135, 105, 105]);
	prices["Pleasenton"] = 								([0, 125, 105, 105, 105]);
	prices["Pittsburg"] = 								([0, 155, 165, 125, 125]);
	prices["Portola Valley"] = 							([0, 95, 115, 125, 95]);
	prices["Redwood City"] = 							([0, 85, 105, 95, 75]);
	prices["Redwood Shores"] = 							([0, 85, 105, 95, 75]);
	prices["Richmond"] = 								([0, 105, 155, 85, 85]);
	prices["Rodeo"] = 									([0, 115, 155, 105, 95]);
	prices["Ross"] = 									([0, 105, 155, 105, 85]);
	prices["Sacramento"] = 								([0, 305, 325, 295, 295]);
	prices["San Anselmo"] = 							([0, 105, 155, 105, 85]);
	prices["San Carlos"] = 								([0, 85, 105, 95, 75]);
	prices["Santa Clara"] = 							([0, 115, 105, 115, 115]);
	prices["San Francisco"] = 							([0, 55, 125, 75, 45]);
	prices["San Jose North"] = 							([0, 115, 115, 115, 125]);
	prices["San Jose South"] = 							([0, 125, 125, 125, 135]);
	prices["San Leandro"] = 							([0, 95, 105, 75, 85]);
	prices["San Lorenzo"] = 							([0, 95, 115, 75, 85]);
	prices["San Mateo"] = 								([0, 75, 105, 85, 75]);
	prices["San Pablo"] = 								([0, 95, 155, 95, 75]);
	prices["San Quentin"] = 							([0, 105, 155, 105, 85]);
	prices["San Rafael"] = 								([0, 105, 155, 105, 85]);
	prices["San Ramon"] = 								([0, 125, 125, 105, 105]);
	prices["Saratoga"] = 								([0, 115, 105, 125, 115]);
	prices["Sausalito"] = 								([0, 85, 145, 95, 65]);
	prices["Sharon Heights"] = 							([0, 85, 105, 105, 85]);
	prices["Stanford"] = 								([0, 85, 105, 105, 85]);
	prices["Stinson Beach"] = 							([0, 135, 215, 155, 115]);
	prices["Sunol"] = 									([0, 135, 105, 105, 125]);
	prices["Sunnyvale"] = 								([0, 105, 105, 115, 115]);
	prices["Terra Linda"] = 							([0, 105, 155, 105, 95]);
	prices["Tiburon"] = 								([0, 105, 155, 115, 85]);
	prices["Walnut Creek"] = 							([0, 115, 135, 105, 95]);
	prices["Woodside"] = 								([0, 85, 105, 105, 85]);
	prices["Yosemite"] = 								([0, 365, 385, 355, 355]);
	prices["Union City"] = 								([0, 95, 105, 85, 95]);

	
	
	
	function calcRate(t)
	{
		
		var goingFrom  = t.form.or.options[t.form.or.options.selectedIndex].value;
		var goingTo  = t.form.de.options[t.form.de.options.selectedIndex].value;
		
		try
		{
		//alert( goingFrom + " " + goingTo)
			if (goingFrom.indexOf("Choose a Destination") > -1 || goingTo.indexOf("Choose a Destination") > -1 )
			return;
		}
		catch(e)
		{
		//ignore
		}
			var goingFrom  = t.form.or.options[t.form.or.options.selectedIndex].value;
			var goingTo  = t.form.de.options[t.form.de.options.selectedIndex].value;
			//alert(goingTo + " " + goingFrom)
			if(goingFrom == "San Francisco Airport" 
				|| goingFrom == "San Jose Airport"
				|| goingFrom == "Oakland Airport"
			)
			{
			//alert(goingFrom + " xxx " + t.form.de.options.selectedIndex + " " + t.form.or.options.selectedIndex)
				document.getElementById("rate_box").innerHTML = "<b>Estimated Price $"  +  prices[goingTo][t.form.or.options.selectedIndex]
			+ "</b>";
			}
			else if(goingFrom == "San Francisco")
			{
				if(goingTo == "San Francisco Airport" 
				|| goingTo == "San Jose Airport"
				|| goingTo == "Oakland Airport" )
				{
				
				document.getElementById("rate_box").innerHTML = "<b>Estimated Price $"  +  prices["San Francisco"][specialDestinations[goingTo]]
			+ "</b>";
				}
				else
				{
				document.getElementById("rate_box").innerHTML = "<b>Estimated Price $"  +  prices[goingTo][4]
				}
			}
			else 
			{
				if(goingTo == "San Francisco")
				{
					document.getElementById("rate_box").innerHTML = "<b>Estimated Price $"  +  (prices[goingFrom][4])
			+ "</b>";
				}
				else
				{
					//alert(goingFrom + " ddd " + t.form.de.options.selectedIndex)
					document.getElementById("rate_box").innerHTML = "<b>Estimated Price $"  +  (prices[goingFrom][t.form.de.options.selectedIndex+1]-10)
					+ "</b>";
				}

			}
	}
	
	function cl(t)
	{
		//alert(t.options[t.options.selectedIndex].value)
			document.getElementById("rate_box").innerHTML = "";
		if(t.options[t.options.selectedIndex].value == "San Francisco Airport" 
					|| t.options[t.options.selectedIndex].value == "San Jose Airport"
					|| t.options[t.options.selectedIndex].value == "Oakland Airport"
					)
		{
			//populate right select box with cities only since airport was selected	
			populateSelect(t.form.de, cities);
		}
		else if(t.options[t.options.selectedIndex].value == "San Francisco")
		{
			populateSelect(t.form.de, air, cities)
		}
		else
		{
			//since city was selected - populate box with airports only.
			populateSelect(t.form.de, air)
		}
	}
	
	function populateSelect(sel, array, extraArray)
	{
			//alert(sel.options.length + ": "+ (air.length+cities.length) + " " + array.length)
			try
			{
				//alert(sel.options.length)
				for(var i = (air.length+cities.length); i> 0 ; i--)
				{
					sel.options[i] = null;
					
				}
				sel.options = null;
			}
			catch(e)
			{
				//alert(e.message)
			}
			//sel.options[0] = new Option("Choose a Destination To...", "Choose a Destination To...");
			for(var i = 0; i < array.length; i++)
			{
				sel.options[i] = new Option(array[i], array[i]);
			}
			if(extraArray != null) 
			{
				for(var i =0; i < extraArray.length; i++)
				{
					sel.options[array.length+ i] = new Option(extraArray[i], extraArray[i]);
				}
			}
	}
	