﻿﻿jQuery.rangerCabCompany = function () {    // header & footer Links    $('.home').click(function() {$(location).attr('href', 'http://www.rangercab.com');});    $('.aboutUs').click(function() {$(location).attr('href', '/rangercab_about_us.html');});    $('.rates').click(function() {$(location).attr('href', '/rangercab_rates.html');});    $('.discounts').click(function() {$(location).attr('href', '/rangercab_discounts.html');});    $('.military').click(function() {$(location).attr('href', '/rangercab_military.html');});    $('.aroundColumbus').click(function() {$(location).attr('href', '/rangercab_around_columbus.html');});    $('.contactUs').click(function() {$(location).attr('href', 'mailto:rangercabcompany@gmail.com');});    if ($('#loopedSlider').length) {        $('#loopedSlider').crossSlide({sleep: 5, fade: 1}, [            { src: '/images/photo/Ranger_Cab_Taxi_1.jpg'},            { src: '/images/photo/Ranger_Cab_Taxi_2.jpg'},            { src: '/images/photo/Ranger_Cab_Taxi_3.jpg'},            { src: '/images/photo/Ranger_Cab_Taxi_4.jpg'},            { src: '/images/photo/Ranger_Cab_Taxi_5.jpg'},            { src: '/images/photo/Ranger_Cab_Taxi_6.jpg'}        ]);    }    $('.hotel, .attraction').click(function () {        $('.img-box1 h4 span').html($(this).html());        codeAddress($(this).attr('address'));        $('.hotelDetail, .attractionDetail').hide();        var id = $(this).attr('ID');        $('#'+id+'Div').show();    });}
var map;
var geocoder;
function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(32.4608333, -84.9877778);
    var myOptions = {
      zoom: 10,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  }

  function codeAddress(address) {
    var myOptions = {
      zoom: 14,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
  }
