function newAirportBox(inputfield){if(inputfield=='airport'){if(document.getElementById(inputfield).selectedIndex=='0'){document.form.pickup_address.value='';document.form.pickup_zip.value='';document.form.pickup_address.disabled=false;document.form.pickup_city.disabled=false;document.form.pickup_zip.disabled=false;return true}else if(document.getElementById(inputfield).selectedIndex=='1'){document.form.pickup_address.value='5757 Wayne Newton Boulevard';document.form.pickup_city.selectedIndex='0';document.form.pickup_zip.value='89119';document.form.pickup_address.disabled=true;document.form.pickup_city.disabled=true;document.form.pickup_zip.disabled=true;return true}else if(document.getElementById(inputfield).selectedIndex=='2'){document.form.pickup_address.value='7135 Gilespie St';document.form.pickup_city.selectedIndex='0';document.form.pickup_zip.value='89119';document.form.pickup_address.disabled=true;document.form.pickup_city.disabled=true;document.form.pickup_zip.disabled=true;return true}}else{if(document.getElementById(inputfield).selectedIndex=='0'){document.form.destination_address.value='';document.form.destination_zip.value='';document.form.destination_address.disabled=false;document.form.destination_city.disabled=false;document.form.destination_zip.disabled=false;return true}else if(document.getElementById(inputfield).selectedIndex=='1'){document.form.destination_address.value='5757 Wayne Newton Boulevard';document.form.destination_city.selectedIndex='0';document.form.destination_zip.value='89119';document.form.destination_address.disabled=true;document.form.destination_city.disabled=true;document.form.destination_zip.disabled=true;return true}else if(document.getElementById(inputfield).selectedIndex=='2'){document.form.destination_address.value='7135 Gilespie St';document.form.destination_city.selectedIndex='0';document.form.destination_zip.value='89119';document.form.destination_address.disabled=true;document.form.destination_city.disabled=true;document.form.destination_zip.disabled=true;return true}}}var geocoder,location1,location2,gDir;function initialize(){geocoder=new GClientGeocoder();gDir=new GDirections();GEvent.addListener(gDir,"load",function(){var drivingDistanceMiles=Math.round((gDir.getDistance().meters/1609.344)*100)/100;var totalestimated=(drivingDistanceMiles*2.60)+(drivingDistanceMiles*.432)+3.30;if(document.forms[0].airport.selectedIndex==1||document.forms[0].airport.selectedIndex==2){var airportfee='$1.80';totalestimated=totalestimated+1.80}else{var airportfee='$0.00'}if(document.forms[0].cc.selectedIndex==1){var ccfee='$3.00';totalestimated=totalestimated+3.00}else{var ccfee='$0.00'}document.getElementById('results').innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td valign="top"><strong>From: </strong></td><td>'+location1.address+'</td></tr><tr><td valign="top"><strong>To: </strong></td><td>'+location2.address+'</td>  </tr>  <tr><td valign="top"><strong>Distance: </strong></td>	<td>'+drivingDistanceMiles+' miles</td> </tr> <tr><td><strong>Airport Fee?</strong></td>			<td>'+airportfee+'</td></tr> <tr><td><strong>Credit Card Fee?</strong></td>			<td>'+ccfee+'</td></tr><tr><td nowrap><strong>Estimated Fare:</strong></td><td><span class="fareest">$'+Math.round(totalestimated*100)/100+'</span></td> </tr> </table><br><strong>GRATUITY IS NOT INCLUDED</strong>'})}function showLocation(){geocoder.getLocations(document.forms[0].pickup_address.value+","+document.forms[0].pickup_zip.value,function(response){if(!response||response.Status.code!=200){alert("Sorry, we were unable to geocode the first address")}else{location1={lat:response.Placemark[0].Point.coordinates[1],lon:response.Placemark[0].Point.coordinates[0],address:response.Placemark[0].address};geocoder.getLocations(document.forms[0].destination_address.value+","+document.forms[0].destination_zip.value,function(response){if(!response||response.Status.code!=200){alert("Sorry, we were unable to geocode the second address")}else{location2={lat:response.Placemark[0].Point.coordinates[1],lon:response.Placemark[0].Point.coordinates[0],address:response.Placemark[0].address};gDir.load('from: '+location1.address+' to: '+location2.address)}})}})}
