// ----------------------------------------------------------------------------------------------------
/*
   Program: a1villa_map.js

   Author:  James Whitfield
   Date:    23 January 2010

   Description:
   Controls for Google map.

   Amendments:

   DD/MM/YY  XXX  ........

*/
// ----------------------------------------------------------------------------------------------------

var map;
var bounds;


// ----------------------------------------------------------------------------------------------------
// Add locations on the map - with title, image and description.
// ----------------------------------------------------------------------------------------------------

function AddLocationToMap(locTitle, locImage, locComments, locLatitude, locLongtitude, markerOptions) {

  var locCoords = new GLatLng(locLatitude, locLongtitude);
  var locMarker = new GMarker(locCoords, markerOptions );
  GEvent.addListener(locMarker, "click",
         function() {
                      var locHTML= "<table border='0' width='200' cellspacing='0' cellpadding='0'>" +
                                   "<tr><td class='f133copyright'>" + locTitle + "</td></tr>" +
                                   "<tr><td class='gap10'></td></tr>" + 
                                   "<tr><td align='center'><img src='http://www.a1villa.com/images/map/" + locImage + "' height='150' width='200'></td></tr>" + 
                                   "<tr><td class='gap10'></td></tr>" +
                                   "<tr><td><p align='justify'>" + locComments + "</td></tr></table>";
                      map.openInfoWindowHtml(locCoords, locHTML);
                    } );
  map.addOverlay(locMarker);
  bounds.extend(locCoords);
};

// ----------------------------------------------------------------------------------------------------
// Display the Google map with settings as appropriate.
// ----------------------------------------------------------------------------------------------------

function InitializeGoogleMap() {
  if (GBrowserIsCompatible()) {
     map        = new GMap2(document.getElementById("map_canvas"));
     var mapOptions = { googleBarOptions : { style : "new" }}

     map.setCenter(new GLatLng(28.40,-81.50), 12);
     map.addControl(new GLargeMapControl3D ());
     map.addControl(new GMapTypeControl ());
     map.enableGoogleBar();
//     map.setUIToDefault();

     bounds = new GLatLngBounds();

     var markerIcon    = new GIcon(G_DEFAULT_ICON);
     markerIcon.image  = "http://www.a1villa.com/images/map/marker_orange.gif";

     markerOptions = { icon:markerIcon };
     AddLocationToMap("Indian Wells", "indianwells.jpg", "Best location for visiting the area, with parks, shops and restaurants on your doorstep.", 28.343518,-81.493857, markerOptions);

// Disney, Universal & Seaworld
     markerIcon.image  = "http://www.a1villa.com/images/map/marker_pink.gif";
     AddLocationToMap("Downtown Disney", "downtowndisney.jpg", "Disney Quest, Cirque du Soleil, AMC Cinema, Pleasure Island, Planet Hollywood, Wolfgang Puck and many more restaurants.", 28.371002,-81.518008, markerOptions);
     AddLocationToMap("EPCOT", "epcot.jpg", "Science themed park with Mission: SPACE, Test Track, Soarin', all based around a lake with themed restaurants from 13 countries of the world.", 28.368255,-81.548295, markerOptions);
     AddLocationToMap("Hollywood Studios", "hollywoodstudios.jpg", "Get into the Hollywood movies with the Rock'n'Rollercoaster, fall in the Tower of Terror and watch stuntmen do their stuff.", 28.358248,-81.554775, markerOptions);
     AddLocationToMap("Typhoon Lagoon", "typhoonlagoon.jpg", "Waterpark offering a huge wave machine, beech, lazy river and everything to chill out and top up the tan!", 28.365763,-81.528254, markerOptions);
     AddLocationToMap("Animal Kingdom", "animalkingdom.jpg", "Go on safari and see elephants, tigers, gorillas in the wilderness of Kissimmee!  Brave Expedition Everest and ride the jungle rapids.", 28.357341,-81.590652, markerOptions);
     AddLocationToMap("Magic Kingdom", "magickingdom.jpg", "Iconic park with Cinderella's castle, Mickey and all his friends.  Ride Splash Mountain, Space Mountain and Big Thunder Railroad.", 28.404085,-81.580439, markerOptions);
     AddLocationToMap("Wide World of Sports", "disneysports.jpg", "Huge athletic complex for amateur and professional sports people.  Incorporates baseball stadium, sports arena and more.", 28.339514,-81.551085, markerOptions);
     AddLocationToMap("Universal Studios", "universalstudios.jpg", "Incorporates Universal Orlando, Islands of Adventure (with the new Harry Potter theme park) and Citywalk.", 28.474878,-81.469803, markerOptions);
     AddLocationToMap("Seaworld", "seaworld.jpg", "See Shamu spashing the crowds, sharks, seal and sealife galore or take to the Atlantis waterlogs, Kracken or the new Manta rollercoasters.", 28.41194,-81.46361, markerOptions);
     AddLocationToMap("Acquatica", "aquatica.jpg", "Orlando's newest and most fantastic of the water parks.  Huge wave pools, white water rapids, lazy river and even tube slides with Dolphins!", 28.415447,-81.456349, markerOptions);

// Attractions & Eating out
     markerIcon.image  = "http://www.a1villa.com/images/map/marker_teal.gif";
     AddLocationToMap("US192 Restaurants", "us192.jpg", "Chili's, Olive Garden, TGI Fridays, IHOP, Perkins, Macaroni Grill, Uno's, steakhouses and eat-all-you-can buffets galore.. the list is endless.  Also includes the local flee market and the big 'Orange World' shop!", 28.332876,-81.495788, markerOptions);
     AddLocationToMap("US192/SR535", "poincianaplace.jpg", "The local Publix supermarket with ATM and adjoining liquor store, Smokey Bones, Burger King, Fish & Chip restaurant,Chinese take-away, Taco Bell, Bob Evans, Pizza Hut, Blockbuster and many others.", 28.334679,-81.477871, markerOptions);
     AddLocationToMap("SR535 Restaurants", "sr535.jpg", "Bennigans, Bahama Breeze, Wendys, Golden Corral, Lonestar Steakhouse, Landry's Seafood and many more...", 28.370634,-81.503448, markerOptions);
     AddLocationToMap("Old Town", "oldtown.jpg", "Fun-park, white-knuckle rides, a haunted house, quirky shops, live music, bars, restaurants, bike and car cruises - this is Orlando's best free attraction for a reason.", 28.329618,-81.515293, markerOptions);
     AddLocationToMap("Medieval Times", "medievaltimes.jpg", "Evening family dinner show with knights, horses and wholesome, hearty food!", 28.306345,-81.463623, markerOptions);
     AddLocationToMap("International Drive", "internationaldrive.jpg", "Very popular area of Orlando with the British holiday makers.  Expect hundreds of restaurants, shops, attractions (including Wonderworks - the upside-down building) and the obligatory themed crazy golf.", 28.435034,-81.472378, markerOptions);
     AddLocationToMap("The Loop - Eating", "theloop2.jpg", "Not just shops, but also a cinema complex, bars and restaurants - including Chilis, Johnny Rockets, Macaroni Grill, BJs, Pei Wei Asian, Abuelos Mexican, Logans, Olive Garden and many others.", 28.343480, -81.422746, markerOptions);

// Golf 
     markerIcon.image  = "http://www.a1villa.com/images/map/marker_green.gif";
     AddLocationToMap("Falcons Fire", "falconsfire.jpg", "Rees Jones signature par 72 golf course, excellent clubhouse and recognised as one of Florida's premier courses.  All this and it borders Indian Wells!", 28.342763,-81.500702, markerOptions);

// Business & Airport
     markerIcon.image  = "http://www.a1villa.com/images/map/marker_yellow.gif";
     AddLocationToMap("Gaylord Palms", "gaylordpalms.jpg", "Spectacular hotel and convention center with first-class restaurants, tropical plants and all under a glass roof.", 28.344425,-81.525936, markerOptions);
     AddLocationToMap("Orange County Convention Center", "orangecounty.jpg", "Major convention center at the south-side of International Drive.  Indian Wells is a popular alternative to renting a hotel room.", 28.425147,-81.461735, markerOptions);
     AddLocationToMap("Orlando International", "orlandoairport.jpg", "A fantastic airport that is the main hub for British Airways and Virgin Atlantic.  Majority of charter flights from UK use Sanford airport (north Orlando).", 28.442431,-81.311531, markerOptions);

// Shopping...
     var markerOptions = "";
     AddLocationToMap("Lake Buena Vista Outlets", "lbvoutlets.jpg", "Opposite Indian Wells and ideal when you want to shop for bargains without the crowds.  Also Frankie Farells Irish bar and the LBV Spa.", 28.350188,-81.487241, markerOptions);
     AddLocationToMap("Premium Outlets", "premiumoutlets.jpg", "Designer goods at factory outlet prices - Armani, Nike, Ralph Lauren, DKNY - the list is endless.  The biggest and the best!", 28.387625,-81.491818, markerOptions);
     AddLocationToMap("WalMart", "lbvwalmart.jpg", "The supermarket for everything and so local.  Also numerous smaller specilist shops, a medical centre, bars and eateries adjoining.", 28.342536,-81.485338, markerOptions);
     AddLocationToMap("The Loop - Shopping", "theloop.jpg", "New shopping and entertainment complex, with a vast array of big brand stores  - including JC Penneys, Kohls, Michael's, Bed, Bath and Beyond. ", 28.343886, -81.427842, markerOptions);


//     map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));


  };
};


